Jump to content

batch file to copy folders to all cad machines


The Courage Dog

Recommended Posts

Hi, i do maintaning the cad system in our company, i have created certain folder with sub-folders & i want to copy these folder & sub-folder to all can machines to their local drive C:\ (50 numbers), instead of going to each machine & copy the folders one by one, is there any batch file that can automate this process by just running the batch file by the users

then it will automatically copied folders to ther local machines in c

drive C:\.

 

your idea needed, thanks

 

the courage dog

Link to comment
Share on other sites

Can I ask why you are copying folders to users' local hard drives when there is potential that they could modify them in some way further down the line ?

Surely, the best way to manage a cad system is to have all shareable content in one place on a server that is only modifyable by one person (or a selected number of people)

Link to comment
Share on other sites

I would have to agree with NBC, it sounds like a recipe for disaster.

 

I can only imagine doing this with support files that do not require modification and locking access rights after the copy. But even still, maintainng would be difficult should you decide a change needed to be made.

Link to comment
Share on other sites

Hi, i do maintaning the cad system in our company, i have created certain folder with sub-folders & i want to copy these folder & sub-folder to all can machines to their local drive C:\ (50 numbers), instead of going to each machine & copy the folders one by one, is there any batch file that can automate this process by just running the batch file by the users

then it will automatically copied folders to ther local machines in c

drive C:\.

 

your idea needed, thanks

 

the courage dog

you could do something like this. *untested* just replace the drive letters that you need. and the files that you want in this example its just for .dwg and save it as a .bat file and run it. I'd suggest doing a test first...

xcopy h:\*.dwg c:\*.dwg /d /s

Link to comment
Share on other sites

one major reason why i want to save the folders in drive c:\ we want to save space in the server as much as we could. Backup (.BAK) drawings can be set automatically to save it to local drive c:\, also the temporary drawing file & temporary reference files for ease retrival.

Link to comment
Share on other sites

  • 1 month later...

You can use this scripting approach to copy an entire folder structure from a local computer to several workstations automatically at once.

 

Create a list of computers on the network in a file C:/List.txt, one entry per line. The entry may contain the hostname or the ip address of the workstation.

 

 

Here is a quick script.

 

 

 
# Script CopyToWorkstations.txt
var str sourcefolder, destfolder, wkstnlist, wkstn, cmd
# Read the workstn list into a string variable.
cat "C:/List.txt" > $wkstnlist
# Get the first wkstn.
lex "1" $wkstnlist > $wkstn
# Go thru wkstns one by one.
while ($wkstn <> "")
do
   # Create the robocopy command.
   set $cmd="robocopy /E \""+$sourcefolder+"\" \"\\\\"+$wkstn+"\\C$\\"+$destfolder+"\""
   # Execute robocopy.
   system -s $cmd
   # Get the next wkstn.
   lex "1" $wkstnlist > $wkstn
done

 

 

 

This script is in biterscripting. Save the script to file "C:/Scripts/CopyToWorkstations.txt". Run it with this command.

 

 

script "C:/Scripts/CopyToWorkstations.txt" sourcefolder("C:/Test1") destfolder("/Test2")

 

Will copy the entire folder structure under C:/Test1 on the local computer to the folder C:/Test2 on each of the computers listed in file C:/List.txt. I use things like this daily. Once you master a script like this, you can keep reusing it.

Link to comment
Share on other sites

  • 2 weeks later...

We have had problems in the past about space on the server and the best answer is good house keeping by everyone.

 

We have a working directory and completed directories, the completed are searched for bak log dwl sv$ plt and these are deleted. The savings can be big.

 

The other thing is purging your drawings and making sure you have no junk in the drawing, often I find our guys have stuff copied from other drawings and not removed, we have add on software and it creates extra layout tabs I found 12 in one drawing not required.

 

Do you have pdfs of every drawing ? Look at a better auto system when required.

 

Also there are some big overheads in Autocad DWGS if its a simple drawing dont use your C3D template it holds an enourmaous amount of stuff you can not delete. Wblock works wonders on simple drawings.

 

Check your templates make sure they are not full of hidden unused blocks.

 

Look here lots of posts re dwg size a typical reduction is around 50%+.

Link to comment
Share on other sites

I distribute a compiled batch file that copies all support files (blocks, templates, .cui) from a specified location to each local hard drive. All of the paths are the same on all the end users' machines. It's not reasonable for all to pull from the server, because we have a lot of remote engineers and CAD, and to expect them to only be able to work when connected via VPN is ludicrous. I have employed this technique, and have an added gem of creating a log file that copies up to point on the server, so that I know who has updated, and who has not (trust but verify). I'd be happy to assist you in creating a similar batch file (and provide you a link to a free compiler so the batch can't be manipulated). Hit me up on PM.

 

 

DNK

Link to comment
Share on other sites

  • 2 weeks later...

Here's a single line batch file that does what you want with a minimum of fuss:

 

copy \\Server\CAD\*.* C:\CAD\*.*

 

Put it in notepad and save it as "testing.bat".. email it to each user and get them to click on it from their desks. (note.. you may have better luck renaming the file AFTER you save it.. because it sometimes wants to name it "testing.bat.txt" whihc isn't going to work)

 

You might need to create the folder on the destination drive, but if that's the case, you just add three lines ahead of that copy line. (put the correct backslash in there):

C:

cd \

md CAD

 

C: This line chooses the drive

cd \ This line ensures you're at the root of the drive.

md CAD This line creates the folder there (in this case C:\CAD\)

 

oh.. and the \\server bit is the path name to the name of our server. You don't need one for the destination computer as long as you're running this batch file ON the destination computer.

 

To run the Batch file, just double click on it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...