Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-08-2004, 08:25 PM   #1
Member (6 bit)
 
Join Date: Nov 1999
Posts: 34
Send a message via ICQ to JIMBOB
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

--------------------------------------------------------------------------
JIMBOB is offline   Reply With Quote
Old 05-09-2004, 08:21 PM   #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
)
and pclist.txt contains lines like this:

Code:
01
02
03
...
33
34
Personally, I'd put whole computer names in pclist.txt and use something more descriptive than "01" as a name for the background.bmp. Anyhow, good luck.
Metaphorically is offline   Reply With Quote
Old 05-11-2004, 04:43 PM   #3
Member (6 bit)
 
Join Date: Nov 1999
Posts: 34
Send a message via ICQ to JIMBOB
yea thats exactly what i was lookin for thanks a lot!

i new there would be a better way of writting it!

thanks

bob
JIMBOB is offline   Reply With Quote
Old 05-11-2004, 10:57 PM   #4
Don't tread on me
 
cobra's Avatar
 
Join Date: Mar 1999
Location: Florida
Posts: 2,121
Send a message via ICQ to cobra Send a message via AIM to cobra
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
cobra is offline   Reply With Quote
Old 05-12-2004, 08:16 AM   #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
Metaphorically is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:14 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2