RE: Script or Other Method to Reboot

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

Thanks for posting here.

>From your post, my understanding of this issue is: when the users try to
run a batch file to restart the computer, they get an error message saying
"A required privilege is not held by the client". If this is not correct,
please feel free to let me know.

Actually, to restart or shutdown the computer via Shutdown command, the
user must be a member of Administrators group. If you don't want to add
the users to Administrators group, you may try to use the following script
to run the batch file:

<package>
<job id="vbs">
<script language="VBScript">
dim wshShell
set wshShell=CreateObject("Wscript.Shell")
wshShell.run("runas /u:ADMINISTRATOR a.bat")
Wscript.Sleep 100
wshShell.AppActivate "Runas"
Wscript.Sleep 300
wshShell.SendKeys "PASSWORD"
Wscript.Sleep 100
wshShell.SendKeys "~"
Wscript.Sleep 100
</script>
</job>
</package>

Note:
1. Please change ADMINISTRATOR to the administrator account on the machine
2. Please change PASSWORD to the password of the administrator account
3. Please change a.bat to the file name of your batch file

You may copy above script to a text file and save as *.wsf file in the same
folder with the batch file. After run the script, any user can restart the
computer.

Hope this helps.

Have a nice day!

Sincerely,
Tom Che
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

=====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>Thread-Topic: Script or Other Method to Reboot
>thread-index: AcYdPJOkxASlZrXgQmekCi7/ojdyTg==
>X-WBNR-Posting-Host: 136.167.76.86
>From: "=?Utf-8?B?Q2hhcmxpZQ==?=" <baboon@xxxxxxxxxxxxxx>
>Subject: Script or Other Method to Reboot
>Date: Thu, 19 Jan 2006 13:09:03 -0800
>Lines: 19
>Message-ID: <2E0F1B09-7827-45E2-A7E3-CB7F49E0CC0D@xxxxxxxxxxxxx>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.windowsxp.configuration_manage
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.windowsxp.configuration_manage:38190
>X-Tomcat-NG: microsoft.public.windowsxp.configuration_manage
>
>Hi -
>
>This shouldn't be too difficult.
>I need to configure some shared machines so that regular users cannot
>shutdown, but can reboot.
>
>I can use Group Policy to Remove Shutdown from the Start Menu and Security
>Box, but then I need something for the user to click on to reboot the
machine
>when needed.
>
>I made a batch file using the Shutdown utility that contains the string
>"shutdown -r -d p:4:1", but when a regular user tries to run they get "A
>required privilege is not held by the client." Regular Users have the
right
>to shut down the machine and the "p:" switch is used, so I'm not sure why
a
>regular user can't use Shutdown in this case.
>
>In any case, can someone show me a script or some other method to do this?
>
>Thanks.
>

.



Relevant Pages

  • RE: Script or Other Method to Reboot
    ... We need different privileges when using Shutdown command and shutdown the ... Yes, if the user has sufficient knowledge and can edit the VB script, we ... >> run a batch file to restart the computer, ...
    (microsoft.public.windowsxp.configuration_manage)
  • RE: VBS Shutdown script loop not working
    ... I want a script to ... First I wrote a batch file using the shutdown command. ... server was shutdown before it returned to the script to get the next server ...
    (microsoft.public.scripting.vbscript)
  • Re: Login Script group membership
    ... Would it be more managable to write this as a vbs instead of a batch file? ... script, as not all o/s's can run a .vbs file directly as a logon script. ... - you'd need to write a wrapper function to invoke ifmember and return the ... In the general case a user can be a member of any number of ...
    (microsoft.public.windows.server.scripting)
  • RE: Script or Other Method to Reboot
    ... How were you able to know that only Administrators can use the Shutdown ... in your script you have given me what I wanted in that it uses Runas ... > run a batch file to restart the computer, they get an error message saying ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Win 98 client WSH "Can not find script file"
    ... My theory is that the client unmaps z: before wscript ... more statements to the batch file after the VBScript program is called. ... >> REM ** Execute VBScript logon script program. ...
    (microsoft.public.windows.server.scripting)