Login | |
|
 |
RE: Script To Copy Files From One Location To Another - 11/15/2006 6:26:43 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
What are you trying to do, copy a file to a new location. then open that file and replace text within the newly created file?
|
|
| |
|
|
|
 |
RE: Script To Copy Files From One Location To Another - 11/16/2006 1:31:08 AM
|
|
 |
|
| |
StylinLancer
Posts: 57
Score: 0
Joined: 10/4/2006
Status: offline
|
I would like to copy all the *.txt in C:\Temp to lets say Z:\Temp. In a sense, I would like to create a backup of all the files in C:\Temp to Z:\Temp. My C:\Temp is on a laptop and Z:\Temp is on my desktop. With the script, I can go in and edit the .txt to whatever file name I want. Maybe *.doc, *.xls, etc. Make sense now?
|
|
| |
|
|
|
 |
RE: Script To Copy Files From One Location To Another - 11/16/2006 2:03:46 AM
|
|
 |
|
| |
ebgreen
Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
|
Yes. So do you want the script to just copy the *.txt files everytime it is run or do you want it to ask you for input and you tell it which files to copy every time it is run? As an aside, there is really no need to script this. This command at a command prompt would do what you are asking for: copy c:\temp\*.txt z:\temp
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Script To Copy Files From One Location To Another - 11/16/2006 2:12:11 AM
|
|
 |
|
| |
StylinLancer
Posts: 57
Score: 0
Joined: 10/4/2006
Status: offline
|
Understood about the command prompt but I want this to run behind the scenes without a dos box popping up. I'm fairly new to vbscript, but it would be nice to ask for an input of what file types to copy.
|
|
| |
|
|
|
 |
RE: Script To Copy Files From One Location To Another - 11/16/2006 2:21:51 AM
|
|
 |
|
| |
ebgreen
Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
|
These two statements are contradictory: "I want this to run behind the scenes without a dos box popping up" "it would be nice to ask for an input of what file types to copy" One says you do not want user interaction and the other says that you do. Either way, search the froum for these keywaords and you should find all the pieces that you need: FileSystemObject CopyFile InputBox
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Script To Copy Files From One Location To Another - 11/16/2006 6:18:32 PM
|
|
 |
|
| |
gdewrance
Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
|
and then theres the quick way Const OverwriteExisting = TRUE Set objFSO = CreateObject("Scripting.FileSystemObject") objFSO.CopyFile "C:\temp\*.txt" , "D:\backup\" , OverwriteExisting
|
|
| |
|
|
|
 |
RE: Script To Copy Files From One Location To Another - 11/17/2006 12:48:25 AM
|
|
 |
|
| |
StylinLancer
Posts: 57
Score: 0
Joined: 10/4/2006
Status: offline
|
Thanks. I'll take a look at the suggestions given and do some searching.
|
|
| |
|
|
|
|
|