Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling a VISIBLE script 1

Status
Not open for further replies.

JPJeffery

Technical User
May 26, 2006
600
GB
Hello

This isn't really a scripting issue but I'm sure I'm not the only one here who's experienced this issue and as I've found this forum to be the most helpful I'm posting this here (as well as in the Windows XP forum).

I've been trying to find a solution to this over the past day or so but I'm just not getting anywhere.

I have a batch file that does a 'user-friendly' reboot. I need to run it under the context of either the domain Administrator or the local Administrator account. The problem is that if the batch file runs under anything other than the current console user the output doesn't display (apart from the psShutdown GUI).

I've tried the command line as just the name of the batch file, I've tried
Code:
"CMD /C reboot.bat"
and
Code:
"CMD /K reboot.bat"
and
Code:
"CMD /K Start reboot.bat"
and even
Code:
"CMD /K call reboot.bat"
I've even tried it as a .VBS file
Code:
"cscript //nologo reboot.vbs"
but the effect is always the same, only the psShutdown GUI appears.

Is it possible to get the output to appear under these circumstances?

For reference, here's the batch file
Code:
@echo off
color 9f
setlocal

psshutdown -e p:4:1 -t 15 -r
cls
echo.
echo.
echo. ******************************************
echo. * Rebooting this PC in 60 seconds.       *
echo. *                                        *
echo. * To cancel the shutdown, activate this  *
echo. * window then press any key.             *
echo. *                                        *
echo. ******************************************
echo.
pause>nul
psshutdown -a
cls
echo.
echo. ******************************************
echo. *           Shutdown aborted!            *
echo. ******************************************
echo.
echo. Press any key to continue . . .
pause>nul
exit

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]
 
Have you tried scheduling it with the AT command or Win32_ScheduledJob ? both of these methods allow you to specify "interact with desktop" ....I'm not sure about the AT command, but I know Win32_ScheduledJob would execute under System account if that would work for you.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
I'll give those a go, ta.

JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top