Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch file to remotely shutdown
Name: stormy Date: December 2, 2005 at 15:38:15 Pacific OS: Windows & Linux CPU/Ram: p4 2.8 Ghz 128 mb ram
Comment:
On my home network I have 4 Windows boxes. 3 are downstairs and 1 is in my room. All of them are pretty lax on security since they have no internet connection. Anyway I can log into each one using null sessions (no user, no pass). So I'm pretty sure I can use shutdown's /m feature to remotely shut them down. Basically I need a batch file that will connect to each and shut them down. I was thinking it would go like this:
step-BY-STEP 1.Get a list of computers (filter by //) and output (>) to file -net view > hosts 2.Establish NULL session with each computer -SET TARGET=blah (read from lines of file) -NET USE %TARGET%\IPC$ * /USER: (%TARGET% should be in \\HOSTNAME format) 3. If it succeeds, shutdown -IF ERRORLEVEL 1 GOTO :shutdown ERRORLEVEL 2 :skip, go back to step 2
But sadly, I suck with batch scripting so I really need your help. -Thanks in advance
Name: Michael J (by mjdamato) Date: December 3, 2005 at 06:28:22 Pacific
Reply:
If you only have 4 machines that need to be shutdown, why do you need the script to dynamically get a list of the computers or attemt a null session?
Just create a batch script with 4 shutdown commands (1 for each computer). If a particular computer is on it will shut down. If its already off it won't matter.
Summary: Hi, I'm looking to create a batch file that first checks if a PC is connected (returns a reply in ping) then if so send a remote shutdown to that PC. So far I have a batch file that parses IP addr...
Summary: I work for a large company with several clients (approx. 800) over a network running a client application. I am looking for a batch file which will find a database profile .ini on their machines, sear...
Summary: Is there a way to put in code within the batch file itself to run this command as admin rather that whatever user opens it? I have a btach file to remote shutdown a pc on the LAN it only works if I'm ...