Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 07-06-2001, 01:28 AM   #1
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
HELP batch file, win2k "soon.exe"

Ok, trying to get this to work.
Wanting to run a batch file remotely in win2k and can't figure out how. help
__________________
Miami, flee it like a native.
cobra is offline   Reply With Quote
Old 07-06-2001, 02:54 AM   #2
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
you can try to schedule a job with the AT scheduler that runs the batch file. You can do this remotely.
mosquito is offline   Reply With Quote
Old 07-06-2001, 01:16 PM   #3
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
Well,
I am unfamiliar with this, really new to the batch stuff, it's for a project at work, trying to impress the boss.
I really need a working example to build on.
Just want to copy a batch file to many pc's, then run the batch file on them. I have tried, but I can't get it right, using all win2k.
help me mosquito! You are the man!
cobra is offline   Reply With Quote
Old 07-08-2001, 10:37 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
got it!

----------------------------------------------
Xcopy /y ttt.bat \\%1\c$\winnt
soon \\%1 60 cmd /c "C:\winnt\ttt.bat"
----------------------------------------------
netsh interface ip set address "Local Area Connection" static 192.168.0.8 255.255.255.0 192.168.0.1 1
add dns "Local Area Connection" 200.100.100.1
add dns "Local Area Connection" 200.100.100.2
netsh exit
----------------------------------------------

now if I can write a script that can do this for multiple machines according to pc name.......ouch
cobra is offline   Reply With Quote
Old 07-09-2001, 03:33 AM   #5
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
the pcname is an environment variable %COMPUTERNAME%, so you can make a selection on this one.

You can put the batch file in the netlogon share on your server, and set it as logon script (or include it in the logon script of your users.)

to schedule a batch file, you use
Code:
at \\computername 12 "c:\blabla.bat"
thanks for the netsh thing, I didn't know it's existance. VERY interesting.

Last edited by mosquito; 07-09-2001 at 03:38 AM.
mosquito is offline   Reply With Quote
Old 07-09-2001, 01:42 PM   #6
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
well,
the script would be a little more complicated than that.

Example:
if pc name is PE2878D1, then set the ip address to 10.37.128.78
(see the correlation between ip and computer name?)
I really don't know anything about parsing, and don't want to write a script for every pc (like 250), would like to use just one.
Just don't know where to start.
Any clues?
cobra is offline   Reply With Quote
Old 07-10-2001, 10:34 AM   #7
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
Parsing a string positional is not easy with shell scripting. I can't remember how to do it, but I'll look it up tomorrow.
mosquito is offline   Reply With Quote
Old 07-10-2001, 06:16 PM   #8
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
nevermind I got it
netsh interface ip set address "Local Area Connection" static 10.37.1%computername:~2,2%.%computername:~4,2% 255.255.255.0 192.168.0.1 1
add dns "Local Area Connection" 200.100.100.1
add dns "Local Area Connection" 200.100.100.2
cobra is offline   Reply With Quote
Old 07-11-2001, 03:29 AM   #9
SQL nutcase
 
mosquito's Avatar
 
Join Date: Sep 2000
Location: Belgium
Posts: 1,136
Send a message via AIM to mosquito
That's it, I used that syntax only once before, and of course, I forgot.
mosquito 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 05:02 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2