Solved

can't robocopy to the multible servers

Posted on 2006-07-01
8
294 Views
Last Modified: 2008-02-01
I'm trying to copy a file with the following small script,but it's not working.What's wrong with it ?Nothing happens when it is run.

Basically,I want to do is :

Copy *.XDB file
FROM C:\Scripts\SAVscripts TO   all the servers that I have in LatestXDB.txt file.
Destination on these servers is \\%%i\C$\Program Files\SAV
Finally create a log file for the result in C:\Scripts\SAVscripts\Logs\


Here is the small script that I'm using :

FOR /F %%i in (D:\Support\scripts\symantec\LatestXDB.txt) do robocopy.exe "C:\Scripts\SAVscripts" "\\%%i\C$\Program Files\SAV" *.xdb /w:1 /r:1 /zb /V /LOG+:C:\Scripts\SAVscripts\Logs\LatestXDB.log

I do have full access on the destination folders.
Any comment?
Thanks

0
Comment
Question by:shebnem
  • 3
  • 3
8 Comments
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
My guess is that LatesXDB.txt is saved in unicode; the "for" command can't handle this. Either save it in ANSI (open in notepad, "Save as", choose ANSI in the dropdown menu), or use 'type LatestXDB.txt' in the for loop:
FOR /F %%i in ('type "D:\Support\scripts\symantec\LatestXDB.txt"') do robocopy.exe "C:\Scripts\SAVscripts" "\\%%i\C$\Program Files\SAV" *.xdb /w:1 /r:1 /zb /V /LOG+:C:\Scripts\SAVscripts\Logs\LatestXDB.log
0
 

Author Comment

by:shebnem
Comment Utility
I've tried both,didn't work unfortunatelly.
Thanks for the suggestion anyway...
0
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
Anything in the log file?
Put an "echo" in front of robocopy.exe, run the script again and check if the correct commands are listed.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:shebnem
Comment Utility
I've checked the log files,nothing specific to this job.
I've put an "echo".It just  appears for a sec and disappears.
0
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
Seems like you looked in the event log? I was talking about the "LatestXDB.log" file; is it created, and if so, is there something in it?
In addition, you can add a "/tee" (verify this, I'm not completely sure it's the correct one) to the options, which will display robocopy's output on the screen as well as in the log file.
When testing batch scripts, always run them from a command window, not by double-clicking them in Explorer, it's easier to see error messages.
You can add a "pause" at the end to stop the command window from closing after being started from Explorer, but this will help you nothing if the script errors out before it reaches the pause command, so go for the first solution.
0
 

Author Comment

by:shebnem
Comment Utility
One of my friend found out what the problem is.Here is the correct line :

FOR /F %%i in (D:\Support\scripts\symantec\XDBdelivery\LatestXDB.txt) do robocopy.exe "\\cmvismon1\c$\Scripts\SAVscripts" "\\%%i\VPHOME" *.XDB /w:1 /r:1 /zb /tee /V /LOG+:D:\Support\scripts\symantec\XDBdelivery\LatestXDB.log



and changed the permissions on shares.It worked great.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
Comment Utility
Closed, 125 points refunded.
Netminder
Site Admin
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now