Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping script

Status
Not open for further replies.

joshdaniels

IS-IT--Management
Aug 16, 2007
5
US
I created a simple script to copy a couple of files to a directory, I need to repeat this process to clients throughout the network. For example, with a script like this

robocopy "C:\example" "\\comp1001\C$\WINDOWS\system32" /V /NP /R:10 /W:30

I need to increase the counter of the workstation, "comp1001" in this example by +1, to comp1002, comp1003, etc. I've looked in looping the process but only able to find *NIX scripts.
 
For i = 1001 to 1999
robocopy "C:\example" "\\comp" & i & "\C$\WINDOWS\system32" /V /NP /R:10 /W:30
Next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top