Login | |
|
 |
RE: issue with robocopy - 4/20/2008 11:19:55 PM
|
|
 |
|
| |
mbouchard
Posts: 1863
Score: 14
Joined: 5/15/2003
From: USA
Status: online
|
the issue is with this line: strCmd = "robocopy C:\Documents and Settings\user1\My Documents " & strText & " sections.dot" Basically, Robocopy is having trouble with the path and is probably seeing the above truncated. One way to see this would be to use .RUN in place of EXEC. Try the below and see if it give you a message. WshShell.Run "cmd /K " & strCmd With that said. Try something like this strCmd = """" & "robocopy C:\Documents and Settings\user1\My Documents " & """" & """" & strText & " sections.dot" & """" Do a search for chr(34) at lease that is what I think the chr for " is. You can look in the WSH docs for more info on the character maps.
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
 |
RE: issue with robocopy - 4/28/2008 12:15:08 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
First, figure out how to build the command that you want at the command line. Do this before you even try writing the VBS command. Once you know exactly what the right command looks like at the command line then you can start figuring out how to build it in VBS.
_____________________________
"... 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: issue with robocopy - 4/28/2008 12:16:51 AM
|
|
 |
|
| |
mbouchard
Posts: 1863
Score: 14
Joined: 5/15/2003
From: USA
Status: online
|
Try this, take the commnd and manually type it into a CMD window. Once you have that working, take it and do this in your script Wscript.Echo strCMD & vbcr & "Robocopy Known Good Command Line Here" And see what you get and compare the lines.
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
 |
RE: issue with robocopy - 4/28/2008 7:09:12 PM
|
|
 |
|
| |
ginolard
Posts: 1024
Score: 21
Joined: 8/10/2005
Status: offline
|
My favourite issue with RoboCopy is the default number of times it will attempt to try and copy a file. /R:n :: number of Retries on failed copies: default 1 million. /W:n :: Wait time between retries: default is 30 seconds. Marvellous. So, if it fails to copy a file, it will try again for you for about, ooh, 6 days ;)
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
|
|