|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (6 bit)
|
Batch file improvements
does anyone know how to change the following extract from a batch file so i dont have to copy and paste it 34 times (once for each pc).
currently this works fine but if i want to change it in the future i need to make the change 34 times!! my knowledge of batch files is pretty limited so any suggestions would be greatly appreciated. ----------------------------------------------------------------------------- net use k: \\terminal01\c$ copy "01 background.bmp" background.bmp copy background.bmp "k:\program files\cafesuite" net use k: /delete net use k: \\terminal02\c$ copy "02 background.bmp" background.bmp copy background.bmp "k:\program files\cafesuite" net use k: /delete net use k: \\terminal03\c$ copy "03 background.bmp" background.bmp copy background.bmp "k:\program files\cafesuite" net use k: /delete etc etc etc up to terminal34 -------------------------------------------------------------------------- |
|
|
|
|
|
#2 |
|
Member (7 bit)
Join Date: Apr 2004
Location: Ontario, Canada
Posts: 91
|
Sure thing, Jimbob, have a look at the for command. I think what you want is something like this:
Code:
for /F %%n in (pclist.txt) do ( rem echo terminal%%n net use k: \\terminal%%n\c$ copy "%%n background.bmp" background.bmp copy background.bmp "k:\program files\cafesuite" net use k: /delete ) Code:
01 02 03 ... 33 34 |
|
|
|
|
|
#3 |
|
Member (6 bit)
|
yea thats exactly what i was lookin for thanks a lot!
i new there would be a better way of writting it! thanks bob |
|
|
|
|
|
#4 |
|
Don't tread on me
|
nice...
a program I use to "mass" batch to many pc's is batch blitz... http://www.nerdcentric.com/ I found it very useful...especially scheduling tasks on a bunch of pc's... check it out, might come in handy |
|
|
|
|
|
#5 |
|
Member (7 bit)
Join Date: Apr 2004
Location: Ontario, Canada
Posts: 91
|
Batch Blitz looks good for the startup scripts on LANs. I don't do network administration myself, but from what I've read, the new MS thing to do is WMI. Have a look at
Microsoft Script Centre or, more specifically, this sample script for the kinds of things you can do with it. The code is in VBScript. Hope it makes your job easier
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|