|
-
June 24th, 2009, 07:44 AM
#1
Registered User
Batch File rookie with an idea
I don't know DOS enough to make the batch file I want to make. What I want to do is make a batch file that I can modify the variables on that can find, then copy, and then paste files to a new directory and a new drive. The reason I need to know the variables is because I want to be able to modify it for situations such as a client wanting me to find and move files for them and rather than do a search then copy and paste I'd prefer to just run a batch file so I can focus on other tasks. In addition to that I am sure I could modify the variables of what file/file type to find, and where to send it for things such as repairs also and probably other tasks when they arise. I already found one someone posted online on another site that details how to do a search and delete batch file but I don't know enough to edit this for my find, copy, and paste.
One Script to rule them all.
One Script to find them.
One Script to bring them all,
and clean up after itself.
-
June 24th, 2009, 08:06 AM
#2
Driver Terrier
Thing about dos batch files is that you have to work in 8.3
Now I assume you want to tell it to go look for all docs or pics or whatever and copy them to another drive? The question is, do you want to preserve the folder structure in which they are found?
You might be better off with robocopy...
-
June 24th, 2009, 08:32 AM
#3
Registered User
At this point folder structure isn't really important. At the moment I just want to make something that can do a search, copy and paste. I intend to modify it to the needs of my virus removal and recovery of core system files when the system won't allow me to because of the infection stopping me and so on. I'm trying to remove myself of the need to plug their drive into a computer as much as possible to reduce time and costs with travel. And might attempt using such in remote assistance.
-
June 24th, 2009, 08:44 AM
#4
Driver Terrier
how about you post some proposed searches?
Would you be searching for say all *.doc* on a machine?
-
June 24th, 2009, 08:50 AM
#5
Registered User
correct the search would be similar to this setup. I am using general file names just for sake of the explanation of what i want to do.
Find *.pst
Copy *found results* to g:\recovered data
The other setup I was going to do for replacements would have been
find *.pst
copy and replace *found results* to g:\recovered data
my biggest hurdle is not knowing the command for copying what was found in the search or even knowing the syntax to set that up.
-
June 24th, 2009, 11:18 AM
#6
Driver Terrier
OK, well you need the for command...
for /r c:\ %X in (*.pst) do (copy %X D:\test\*.*)
If you want to put this in a batch file the %X must be written as %%X - the line above is for you to try out on a command line box - obviously you need to alter the drive letters to suit you.
-
June 24th, 2009, 02:48 PM
#7
Registered User
Cool thanks NooNoo I appreciate the input on that. As a side note my buddy showed me a command to use which I have yet to test for just find and copy which is "xcopy C:\*.pst /S D:\backup"
-
June 24th, 2009, 02:56 PM
#8
Driver Terrier
careful with xcopy - the wrong version will have an interesting effect and it has a problem with long file/path names too.
Also ran your code,
And got
C:\Users\XXX>xcopy C:\*.pst /S D:\test\*.*
File not found - *.pst
0 File(s) copied
Which took a long time to come to that decision
-
June 24th, 2009, 02:58 PM
#9
Registered User
Ew well that's not cool. Thanks for the heads up on that I don't want a faulty tool to rely on.
-
June 25th, 2009, 02:34 AM
#10
Driver Terrier
It's not faulty, it just has several versions....
-
June 25th, 2009, 10:35 AM
#11
Registered User
-
June 25th, 2009, 10:41 AM
#12
Driver Terrier
 Originally Posted by CeeBee
roocopy
Is that the jumped up version of robocopy?
-
June 25th, 2009, 11:47 AM
#13
Registered User
 Originally Posted by NooNoo
Is that the jumped up version of robocopy? 
no, it's the typo version
-
June 25th, 2009, 12:09 PM
#14
Driver Terrier
roo... kangaroo....jumped.... get it? Nevermind....
-
June 25th, 2009, 01:02 PM
#15
Registered User
 Originally Posted by NooNoo
roo... kangaroo....jumped.... get it? Nevermind....
Perhaps if you had called it the "hopped up version" he'd have seen the pun. Also don't you have to install robocopy? I'd prefer not to have to install then uninstall software for this. Thanks for the suggestion though.
Similar Threads
-
By clarinathan in forum Tech-To-Tech
Replies: 7
Last Post: December 16th, 2010, 09:48 PM
-
By Irish Shark in forum Windows Server 2003 & Windows Home Server
Replies: 1
Last Post: June 15th, 2008, 03:41 PM
-
By Master Frodo UK in forum Programming And Web Design
Replies: 1
Last Post: August 21st, 2006, 10:34 AM
-
Replies: 2
Last Post: November 14th, 2005, 10:16 PM
-
By oldsaltydog in forum Digital Imaging
Replies: 3
Last Post: May 31st, 2005, 05:38 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks