• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Copying files with a .bat file

smp

Diamond Member
in particular .. I don't know how to get long names with spaces into .bat files or the command line .. this has always bugged me. For example .. this is what I want to copy;

C:\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4

to

C:\Documents and Settings\All Users\Start Menu

but doing a;

copy C:\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4 C:\Documents and Settings\All Users\Start Menu

doesn't work! Why?!? I know I'm supposed to put % or ~ in there somewhere but for the life of me I can't figure it out .. I'm on win2k BTW. Thank you!
 
To clarify a little:

copy C:\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4 C:\Documents and Settings\All Users\Start Menu
should be:
copy "C:\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4" "C:\Documents and Settings\All Users\Start Menu"

The same thing can be done including wild cards, and also for the destination directory, as in:
cd "D:\Backup\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4"


edit: Critical errors in positioning of quotes!! 😱




 
grrr ... it's not working. What I'm trying to do .. is I have an install going using sysdiff right, so I threw the sysdiff stuff in a bat file .. now, the sysdiff stuff happens okay but my line;

copy "C:\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4 C:\Documents and Settings\All Users\Start Menu\Programs"

which is after the install doesn't do anything. What I did to troubleshoot it is put it in it's own .bat file .. and it still doesn't do anything .. what am I doing wrong? I'm new at this so take it easy on me. That line above was just pasted into a text file and saves as shortcut.bat . and when I run it, nothing happens .. the command window opens for a split second but that's it .. like it runs but just doesn't do what it's supposed to.
 
Bump for my edit-corrections. Note the quotes around each parameter of the copy command.

I missed the C:\ in your copy statement. 😱
 
So like this;

copy "C:\Documents and Settings\administrator\Start Menu\Programs\FontLab Applications\FontLab4" "C:\Documents and Settings\All Users\Start Menu\Programs"

?? 🙂

edit: nope that didn't work either 🙁
 
If you're trying to copy a directory, you may have better luck w/ xcopy.

Also, you may need a trailing \ on the destination.

Try running this from the command line, so you can see the error message. If there are no files in that directory, it says "0 files copied."

Gotta go...
 
Back
Top