Author Topic: .bat question  (Read 5039 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« 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

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

Craig

  • Guest
.bat question
« Reply #1 on: November 10, 2003, 04:42:23 PM »
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

Craig

  • Guest
.bat question
« Reply #2 on: November 10, 2003, 04:45:41 PM »
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

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« Reply #3 on: November 10, 2003, 04:51:58 PM »
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".  :?:

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

Mark

  • Custom Title
  • Seagull
  • Posts: 28685
.bat question
« Reply #4 on: November 10, 2003, 04:52:44 PM »
Code: [Select]
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"
TheSwamp.org  (serving the CAD community since 2003)

Craig

  • Guest
.bat question
« Reply #5 on: November 10, 2003, 04:57:16 PM »
Go Mr. Thomas, you da man

How the hell do you remember that stuff? I haven't done any major batch filing in ages.

Mark

  • Custom Title
  • Seagull
  • Posts: 28685
.bat question
« Reply #6 on: November 10, 2003, 05:30:12 PM »
Quote from: Craig
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:
TheSwamp.org  (serving the CAD community since 2003)

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« Reply #7 on: November 11, 2003, 01:47:23 PM »
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

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

Mark

  • Custom Title
  • Seagull
  • Posts: 28685
.bat question
« Reply #8 on: November 11, 2003, 02:13:52 PM »
Quote
%username%

Now why didn't I think of that ................ Excellent
TheSwamp.org  (serving the CAD community since 2003)

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« Reply #9 on: November 11, 2003, 06:17:47 PM »
Better yet..

xcopy "S:\AutoCAD 2002\STAMP.dwg" "%appdata%\Autodesk\AutoCAD 2004\R16.0\enu\Support"/Q/R/S/I/Y/K

 :wink:

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« Reply #10 on: November 20, 2003, 12:30:21 PM »
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

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

daron

  • Guest
.bat question
« Reply #11 on: November 20, 2003, 12:36:57 PM »
Are you trying to do it manually? Make sure it isn't read-only.

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« Reply #12 on: November 20, 2003, 12:44:21 PM »
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"

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

Craig

  • Guest
.bat question
« Reply #13 on: November 20, 2003, 01:10:00 PM »
You can use rd to Remove Directories aka folders

ronjonp

  • Needs a day job
  • Posts: 7027
.bat question
« Reply #14 on: November 20, 2003, 01:15:08 PM »
Thanks Craig  :oops:

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC