Jump to content
Sign in to follow this  
ahmeddzcom

HELP ME PLZ .... _RunDos

Recommended Posts

ahmeddzcom

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

...

Share this post


Link to post
Share on other sites
JLogan3o13

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.

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
ahmeddzcom

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 ...

Share this post


Link to post
Share on other sites
ahmeddzcom
Anyone else plz !!! Edited by ahmeddzcom

Share this post


Link to post
Share on other sites
kylomas

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

Share this post


Link to post
Share on other sites
forever0donotknowme

#RequireAdmin
if @ComputerName ="MiniXP" then
Shutdown(5)
Else
Exit
EndIf

Share this post


Link to post
Share on other sites
JLogan3o13

forever0donotknowme, that doesn't do what the OP is asking.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×