Jump to content

Prompt a user for reboot the machine in Vista and schedule it.


Recommended Posts

Posted

i have a little problem, pls help if you can.

i make silent software installations and some of the softwares require a reboot. how can i pop-up a dialog box to the user to notify him/her to reboot the machine and schedule this task.

i tried the following:

i have a vbscript, when i run it manually everything is fine pops up a window and makes the thing i choose, but i can't schedule it because the deployment runs as local system account and local system account does not have rights to run interactively and i don't know the username/password for the actual machine.

here's the PromptUser.vbs:

Set objShell = CreateObject("Wscript.Shell")

intMessage = Msgbox("A restart required due to Software installation! If you want to restart now choose YES if you plan later choose NO ", _

vbYesNo, "Reboot prompt for the User!")

If intMessage = vbYes Then

objShell.Run("shutdown -r -t 20")

Else

Wscript.Quit

End If

here's the schtasks command:

c:\windows\system32\schtasks /create /tn PromptUserForReboot /tr "c:\Prompt\PromptUser.vbs" /sc MINUTE

Thanks for your help

regards,

r


Posted
i have a vbscript, when i run it manually everything is fine pops up a window and makes the thing i choose, but i can't schedule it because the deployment runs as local system account and local system account does not have rights to run interactively and i don't know the username/password for the actual machine.

You're out of luck then. You need to get the administrative account and use task scheduler to make an event that way.

Vista has very tight security controls for "unscheduled events'.

Posted
i have a vbscript, when i run it manually everything is fine pops up a window and makes the thing i choose, but i can't schedule it because the deployment runs as local system account and local system account does not have rights to run interactively and i don't know the username/password for the actual machine.

You're out of luck then. You need to get the administrative account and use task scheduler to make an event that way.

Vista has very tight security controls for "unscheduled events'.

thanks for your reply, i tried it, i scheduled as an administrator user but it runs only for that user. i have another idea, i get from registry the last logged on user data with a small vbs (DOMAIN\USERNAME) but the password of the current user is still missing, so it won't work :(

anyway thx

regards,

roland

Posted
i have a vbscript, when i run it manually everything is fine pops up a window and makes the thing i choose, but i can't schedule it because the deployment runs as local system account and local system account does not have rights to run interactively and i don't know the username/password for the actual machine.

You're out of luck then. You need to get the administrative account and use task scheduler to make an event that way.

Vista has very tight security controls for "unscheduled events'.

thanks for your reply, i tried it, i scheduled as an administrator user but it runs only for that user. i have another idea, i get from registry the last logged on user data with a small vbs (DOMAIN\USERNAME) but the password of the current user is still missing, so it won't work :(

anyway thx

regards,

roland

There must be some way to get this application permission. If you can do that, it will run for all users.

Right-click, go to properties, then the security tab and mess around with the permissions. Do this under administrator. Enable this file to have permission to run for all users.

Posted
There must be some way to get this application permission. If you can do that, it will run for all users.

Right-click, go to properties, then the security tab and mess around with the permissions. Do this under administrator. Enable this file to have permission to run for all users.

There is a problem with the scheduled tasks, i tried to set the job to run whether the user is logged in or not it won't start (General tab Security options / When running the task, user the following user account: .......)

it only runs when the "Run only when user is logged on" option is enabled

i gave up

Found a different solution (renaming original shortcuts and executables and after a reboot a runonce key runs an install.cmd file and it does the rest, renames back everything :) )

thx for your help

regards,

roland

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