Jump to content

Pals of Mine freaked out from the worm-like Message!


Recommended Posts

@Tomcat76 I understand the frustration with AVG, but I believe they made the right call in identifying compiled scripts as a potential danger. And after reading the thoughts of others who use AutoIt, in this case, there really was no downside to running the script in raw form: you edit the final product directly (no need to compile) and uses less space. It took a little time to revamp my routines, but once I was finished it was all good. :P

@MHz Wow, you are the master. I would love to adapt the countdown feature for a simple SplashText box, but I suspect such an option is a no-go with AutoIt(?).

Link to comment
Share on other sites


Here is a HTA that uses a VBS script to reboot the computer.

Save As ReBoot.Hta

Notes

This needs to made active

Inactive

'Set WMISrv = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & strComputer & "\root\cimv2")

'Set ObjOS = WMISrv.ExecQuery("Select * from Win32_OperatingSystem")

' For Each StrOS in ObjOS

' StrOS.Win32Shutdown(Reboot + 4)

'Next

To Make Active Copy And Paste This Into The Red Spot In The Script Or Remove The Quotes In Front Of The Red text '

Set WMISrv = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & strComputer & "\root\cimv2")

Set ObjOS = WMISrv.ExecQuery("Select * from Win32_OperatingSystem")

For Each StrOS in ObjOS

StrOS.Win32Shutdown(Reboot + 4)

Next

This Is Set To A 60 Second Delay Before It Runs The ReBoot Script

INTA = 60

Change This To Suit Your Needs

This Color Text Is Safe To Remove From The HTA As It Only A Message

Box Place Holder For The Script

This Color Is The Icon I Use For The HTA and Might Alert Your

Firewall And Or Anti-Virus

<TITLE> Gunsmokingman Reboot Hta</TITLE>

<HTA:APPLICATION ID="GsmReBoot" APPLICATIONNAME="GsmReBootHta"

SYSMENU="yes" MaximizeButton="No" MinimizeButton="No"

SCROLL="No" SCROLLFLAT ="No"

Icon="http://www3.telus.net/GSMJAK1E/AUABuilder/BgImgs/Hta2.ico"><head>

<!-- ;;;;; RESIZES THE WINDOW ;;;;; -->

<script language="vbscript">

window.resizeTo 500,275

window.moveTo 550, 375

Const LogOff = 0, Shutdown = 1, Reboot = 2,PowerOff = 8

Dim INTA,WMISrv, StrOS, ObjOS '''' VARIBLES FOR THE REBOOT FUNCTION

Dim Act : Set Act = CreateObject("Wscript.shell")

Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

Dim Sd : Sd = Act.ExpandEnvironmentStrings("%systemdrive%")

Dim UName : UName = Act.ExpandEnvironmentStrings("%UserName%")

</script>

<!-- ;;;;; MAIN BODY AND BACK GROUND ;;;;; -->

<Table><body SCROLL="No" Title="This Is The Main Body Pop Up Text" STYLE= "9.75pt Palatino Linotype; color:#006c6c;

filter:progid:DXImageTransform.Microsoft.Gradient (GradientType=0, StartColorStr='#e8e4de', EndColorStr='#c7c3be')">

</Table><Center><BR><span id=DataArea0></Span> <BR><span id=DataArea1></Span>

<script language="vbscript">

On_Load

Function On_Load

Dim Ts : Set Ts = Fso.OpenTextFile(SD & "\Rest1.vbs", 2, true)

Ts.WriteLine "Wscript.sleep 1000"

Ts.close

Set Ts = Fso.OpenTextFile(SD & "\CleanIt.vbs", 2, true)

Ts.WriteLine " Dim Act : Set Act = CreateObject(""Wscript.shell"")"

Ts.WriteLine " Dim Fso : Set Fso = CreateObject(""Scripting.FileSystemObject"")"

Ts.WriteLine " If Fso.FileExists(""Reboot.hta"") Then"

Ts.WriteLine " Fso.DeleteFile(""Reboot.hta"")"

Ts.WriteLine " Fso.DeleteFile(""CleanIt.vbs"")"

Ts.WriteLine " End If"

Ts.close

RunTheTest

End Function

Function Reboot

window.alert "Temp Script Place Holder" & vbcrlf & Uname & ", This Is Safe To Remove From The HTA" &_

vbcrlf & "This Is When The Reboot Script Will Run"

'''' ----> VARIBLES TO USE FOR OTHER FUNCTION OF THIS WMI CLASS

'''' ForcedLogOff = LogOff + 4,ForcedShutdown = Shutdown + 4, ForcedReboot = Reboot + 4,ForcedPowerOff = PowerOff + 4

'''' UNCOMMENT THE FIVE BELOW LINES TO MAKE ACTIVE

'Set WMISrv = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & strComputer & "\root\cimv2")

'Set ObjOS = WMISrv.ExecQuery("Select * from Win32_OperatingSystem")

' For Each StrOS in ObjOS

' StrOS.Win32Shutdown(Reboot + 4)

'Next

'''' UNCOMMENT THE FIVE ABOVE LINES TO MAKE ACTIVE

Exit Function

End Function

Function Rst1 '''' <!-- ;;;;; SCRIPT THIS IS THE AMOUNT OF TIME IT STOPS 1000 = 1 SECOND ;;;;; -->

Act.run(SD & "\Rest1.vbs"), 1 , True

End Function

Function RunTheTest '''' <!-- ;;;;; SCRIPT COUNT DOWN ;;;;; -->

Dim INTA

INTA = 60

DataArea0.InnerHTML = Uname & ", Preparing To Reboot The Local Computer"

Do

INTA = INTA - 1

DataArea1.InnerHTML = "This Will Reboot In = " & INTA

Rst1

Loop Until INTA = 0

DataArea1.InnerHTML = "Preparing to Reboot The Local Machine"

Rst1

Rst1

Reboot

DataArea1.InnerHTML = ""

Fso.DeleteFile(SD & "\Rest1.vbs")

If Fso.FileExists(SD & "\CleanIt.vbs") Then

Act.Run(SD & "\CleanIt.vbs")

end if

Window.close

exit Function

End Function

</script>

Edited by gunsmokingman
Link to comment
Share on other sites

@MHz Wow, you are the master. I would love to adapt the countdown feature for a simple SplashText box, but I suspect such an option is a no-go with AutoIt(?).

SplashText box can accept variables so you can have a similar effect.

Demo:

For $i = 30 To 1 Step -1
SplashTextOn("", "" & @CRLF & "Restarting the machine in " & $i & " seconds" & @CRLF & "", 300, 58, -1, -1, 1, "Arial", 12, 12)
Sleep(1000)
Next
SplashOff()

Link to comment
Share on other sites

just add something like this single line to your usual batch file

ping -n 31 127.0.0.1>nul&wmic OS WHERE Primary="TRUE" CALL Win32Shutdown 6

Where 31 is 30 seconds delay (16 would be 15 seconds delay), and the 6 at the end is 2 (reboot) + 4 (force)

Link to comment
Share on other sites

  • 2 weeks later...

Caution!

If u use driver packs, it may be leftovers on the disk if you force restart for 00 seconds.

I mean, clean up may not finish, that was my case.

Just leave the message, like me: shutdown -r -f -t 60 -c "Restarting to complete installation"

plz guyz

is there any way to hide the restart window with countdown to 0?

some friends of mine, called and told me that my uAXPSP2 CD has got a balster worm! of course they are newbies and kinda (Idiots!) then how come a blsater restart your somputer only once and then the windows start normally :)

however, any help in this?

this is my reboot.cmd:

cmdow @ /HID

shutdown.exe -r -f -t 60 -c "Windows XP will now restart in 60 Seconds..."

net user aspnet /delete

EXIT

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...