Jump to content

Problems with reboot


Recommended Posts

I have a few problems with %reboot%, for some weird reasons

"shutdown.exe -r -f -t" is invoked without the time (0)

I saw this in the core.js file that probably is the cause

	rs = rs.replace(/%reboot%/gi, 'shutdown.exe -r -f -t ');					// force a reboot after X seconds
rs = rs.replace(/%reboot%/gi, 'shutdown.exe -r -f -t 0'); // force a reboot now

there are those 2 replaces one after another but the reboot time isn't specified for the 1° one causing the reboot to fail (the time parameter is mandatory).

Edited by Francesco
Link to comment
Share on other sites


  • 4 months later...
Let me try some stuff.

If you remove the first of those 2 lines the reboot command ("%reboot%" with no other parameters) works fine. I think all you have to do is add an IF block that checks if there's a number after the %reboot% command and then use the first or second replace accordingly.

Edited by Francesco
Link to comment
Share on other sites

  • 3 months later...

The two checks are very similar, but the frirst one looks for a space after %reboot% while the second does not. So, if you do

%reboot% 5

It will wait 5 seconds before restarting. If you do not specify a number it assumes 0 and shuts down immediately.

Link to comment
Share on other sites

The two checks are very similar, but the frirst one looks for a space after %reboot% while the second does not. So, if you do

%reboot% 5

It will wait 5 seconds before restarting. If you do not specify a number it assumes 0 and shuts down immediately.

I use only %reboot% and it doesn't reboot unless I remove the first of those 2 lines from the core.js or I specify the seconds.

The two lines in the core.js are one immediately next the other so if you don't specify a reboot time the reboot command call will be "shutdown.exe -r -f -t " that won't never work, because -t has no time value. No one of those 2 replaces is looking for a space, they both look for the same identical string.

Link to comment
Share on other sites

Weird. Somehow, sometime, the space was removed. There should be a space in the first check:

	rs = rs.replace(/%reboot% /gi, 'shutdown.exe -r -f -t ');					// force a reboot after X seconds

Put a space after the %reboot%.

See the second line where the replace puts a 0 after the -t? In the first one it leaves your specified time there.

Kel: Put this in the latest version.

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