Looks like it wants a name and UNC will not work....... *InitiateSystemShutdown function*
Initiates a shutdown and optional restart of the specified computer. /*Syntax*/ InitiateSystemShutdown($MachineName,$Message,$Timeout,$ForceAppsClosed,$RebootAfterShutdown); $MachineName String that specifies the network name of the computer to shut down. No unc. $Message String that specifies a message to display in the shutdown dialog box. This parameter can be NULL if no message is required. $Timeout Specifies the time (in seconds) that the dialog box should be displayed. While this dialog box is displayed, the shutdown can be stopped by the AbortSystemShutdown function.If zero, the computer shuts down without displaying the dialog box, and the shutdown cannot be stopped by AbortSystemShutdown. $ForceAppsClosed Specifies whether applications with unsaved changes are to be forcibly closed. If this parameter is TRUE, such applications are closed. If this parameter is FALSE, a dialog box is displayed prompting the user to close the applications. $RebootAfterShutdown Specifies whether the computer is to restart immediately after shutting down. If this parameter is TRUE, the computer is to restart. */Example/* use Win32; Win32::InitiateSystemShutdown ('MONTY_PYTHON',300,0,0); $! = Win32::GetLastError(); if ($!) then { print "Can't get it down : $! \n"; } else { print "on is way ...\n"; } */Remarks/* This function only works with NT. I just can't get this function shutting down a local computer. To shut down a remote computer, the calling process must have the REMOTE_SHUTDOWN privilege on the remote computer. David Evans wrote: > Using the IP was a guess, these things are often interchangable. > > Unfortunatly I need to do the reboots on a remote networks where there > are no name services running (WINS or DNS) and the infrastructure does > not allow for NetBIOS broadcasts back to here. > > If I was to add the names to the hosts file, would that work? > OR > If I were to UNC the IP with \\10.10.10.10, would that help? > > Cheers > > > Dave > > -----Original Message----- > From: Bill Luebkert [mailto:[EMAIL PROTECTED] > Sent: 07 February 2008 13:21 > To: David Evans > Cc: perl-win32-admin@listserv.ActiveState.com > Subject: Re: Problem with Win32::InitiateSystemShutdown > > David Evans wrote: > >> Hi >> >> >> >> I am having a problem with the Win32::InitiateSystemShutdown module. >> When I use the following code snippit: >> >> use Win32; >> >> Win32::InitiateSystemShutdown('10.10.10.10', 'log out !', 30, 1, >> 1) or die print $!; >> >> >> I get: >> >> >> No such file or directory1 at >> _C:/Scripting/Remote_Reboot/reboot2.pl >> line 4_. >> >> at C:/Scripting/Remote_Reboot/reboot2.pl line 4 >> >> I am running: >> >> Windows XP SP2 >> Activestate Perl 5.8.8 build 822 >> Developing & debugging in Eclipse 3.3.1.1 with EPIC 0.6.13 >> > > Where did you get the impression that an IP address was an acceptable > argument for machine name ? I don't think it is (I could be wrong). > Why not try a name instead ? Also try $^E or Win32::GetLastError and > see if you can get any further error indication, but I still suspect > it's the IP address that isn't allowed. > > **************************************************************************** > > ********************** > > This email and any files transmitted with it are confidential and > > intended solely for the use of the individual or entity to whom they > > are addressed. If you have received this email in error please notify > > the system manager. > > > > This footnote also confirms that this email message has been swept > > by MONSOON for the presence of computer viruses. > > > > Monsoon Accessorize Ltd > > Registered Company Number: 01098034 > > Registered Office: > > Monsoon Building > > 179 Harrow Road > > London > > W2 6NB > > United Kingdom > > > www.monsoon.co.uk www.accessorize.co.uk > > **************************************************************************** > > ********************** > _______________________________________________ > Perl-Win32-Admin mailing list > Perl-Win32-Admin@listserv.ActiveState.com > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs