ahmeddzcom Posted March 11, 2013 Share Posted March 11, 2013 HI THIS CODE IN FILE BATE @echo Force Shutdown&pause @if "%COMPUTERNAME:~0,6%"=="MiniXP" start shutdown /i 2 /p&exit @shutdown /f /s /t 0 /d u:0:0 BUT I CAN'T MAKE THIS CODE IN SCRIPT AUTOIT ... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 11, 2013 Moderators Share Posted March 11, 2013 ahmeddzcom, I don't do a lot in batch, but it appears you're trying to shut down a machine if it's computername matches "MiniXP" to a certain number of characters, is this correct? If so, I would suggest looking first in the help file for StringinStr: something like this (pseudocode) If part of the @COMPUTERNAME = "MiniXP" Then ... Once you have this piece down, take a look at Shutdown() in the help file. You can use this to mimic the shutdown command in your batch file. ahmeddzcom 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
ahmeddzcom Posted March 11, 2013 Author Share Posted March 11, 2013 ahmeddzcom, I don't do a lot in batch, but it appears you're trying to shut down a machine if it's computername matches "MiniXP" to a certain number of characters, is this correct? If so, I would suggest looking first in the help file for StringinStr: something like this (pseudocode)If part of the @COMPUTERNAME = "MiniXP" Then ...Once you have this piece down, take a look at Shutdown() in the help file. You can use this to mimic the shutdown command in your batch file.tnx ... Link to comment Share on other sites More sharing options...
ahmeddzcom Posted March 15, 2013 Author Share Posted March 15, 2013 (edited) Anyone else plz !!! Edited March 15, 2013 by ahmeddzcom Link to comment Share on other sites More sharing options...
kylomas Posted March 15, 2013 Share Posted March 15, 2013 ahmeddzcom, What have you tried? Post your script and you are likely to get help. Ask for script and you'll be waiting awhile... kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
forever0donotknowme Posted March 15, 2013 Share Posted March 15, 2013 #RequireAdmin if @ComputerName ="MiniXP" then Shutdown(5) Else Exit EndIf Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 15, 2013 Moderators Share Posted March 15, 2013 forever0donotknowme, that doesn't do what the OP is asking. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now