TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ronjonp on November 10, 2003, 04:34:54 PM
-
Not a lisp question, but.......In a .bat file, how do I make a wildcard folder when copying files from one location to another?
Example
copy "S:\AutoCAD 2002\STAMP.dwg" "C:\Documents and Settings\???\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Support*"
Thanks,
Ron
-
You can use xcopy instead of copy and have it select "D" for you. Is that what you were wanting. It's been so long since I'ver heard batch file, I have forgotten alot of it
-
What you might end up having if the above is what your after is
echo d|xcopy c:\AutoCAD 2002\stamp.dwg c:\My New Folder
where My New Folder is where you would want it copied to
-
The folder name already exists (logon name). I need it to accept whatever the name of that folder is and proceed to copy. Right now it prompts "path not found". :?:
-
REM cpt.bat
REM Batch file to copy STAMP.dwg to a users ACAD Support folder
REM Usage cpt <user name>
REM Example cpt John
%1
copy "S:\AutoCAD 2002\STAMP.dwg" "C:\Documents and Settings\%1\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Support"
-
Go Mr. Thomas, you da man
How the hell do you remember that stuff? I haven't done any major batch filing in ages.
-
Go Mr. Thomas, you da man
How the hell do you remember that stuff? I haven't done any major batch filing in ages.
I still use them! :shock:
-
This is what I ended up with.
copy "S:\AutoCAD 2002\STAMP.dwg" "C:\Documents and Settings\%username%\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Support"
:D
-
%username%
Now why didn't I think of that ................ Excellent
-
Better yet..
xcopy "S:\AutoCAD 2002\STAMP.dwg" "%appdata%\Autodesk\AutoCAD 2004\R16.0\enu\Support"/Q/R/S/I/Y/K
:wink:
-
Hey Mark (or any .bat inclined :D ),
Probably a stupid question but.....How do I delete empty folders in a dir?
Also how do I just delete a folder? I can delete the files within the folder but cannot delete the folder itself??
Thanks,
Ron
-
Are you trying to do it manually? Make sure it isn't read-only.
-
I took the read only attribute out of all the files but still cannot get the dir to delete? ---> attrib -R "C:\Program Files\Microsoft Office\Templates
This is what I have:
del "C:\Program Files\Microsoft Office\Templates\Binders"
-
You can use rd to Remove Directories aka folders
-
Thanks Craig :oops:
-
No problem, glad I could finally be of SOME help. Been really busy here at work. I guess thats good....Job Security :?:
-
It's because an app (most likely explorer) has an open handle to the dir. You can close them with a program called Process Explorer from sysinternals.
http://theswamp.org/#freeware