- Thread starter
- #21
G
Gary S. Terhune
Log lines start with "Start ..." and "Shutdown...". I could make the
Shutdown line represent whether shutdown, restart or logoff. But I don't see
the need, and it makes further coding of uptime calculations fairly more
complicated. As for your error, I can't say for sure, but it wouldn't hurt
to reinstall VB runtimes. http://support.microsoft.com/kb/290887/ But it may
be that you have some protective settings or utility getting in the way.
That IS the main drawback of an app based upon scripts.
You might also reinstall the Windows Scripting Host. Last version is 5.6
(SCR56EN.EXE) but you can't find it at MS anymore, so here's a copy:
http://grystmill.com/shared/scr56en.exe
In case the other download also causes problems,
http://grystmill.com/shared/vbrun60sp6.exe
or http://grystmill.com/shared/vbrun60sp5.exe
--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com
"Franc Zabkar" <fzabkar@iinternode.on.net> wrote in message
news:bgik041uuqgcpc3iqnjcu48qgmnp7h97no@4ax.com...
> On Fri, 18 Apr 2008 15:06:16 -0700, "Gary S. Terhune" <none> put
> finger to keyboard and composed:
>
>>No, I'll post the code here, between lines of asterisks.
>>
>>"StartTime.vbs"
>>****************************
>>Option Explicit
>>Dim fso, f
>>Set fso = CreateObject("Scripting.FileSystemObject")
>>Set f = fspenTextFile("C:\uptime.txt", 8, True)
>>f.WriteLine "Start " & now
>>f.Close
>>WScript.Quit
>>******************************
>>
>>"Shutdown.vbs"
>>*****************************
>>Option Explicit
>>Dim fso, f, wso
>>Set wso = WScript.CreateObject("WScript.Shell")
>>Set fso = CreateObject("Scripting.FileSystemObject")
>>Set f = fspenTextFile("C:\uptime.txt", 8, True)
>>f.WriteLine "Shutdown" & now
> ^^^^^^^^^^^^
>
>>f.Close
>>wso.run "C:\WINDOWS\RUNDLL32 SHELL32.DLL,SHExitWindowsEx 9"
>>********************************
>
> I'm no programmer, but have you forgotten to add explanatory notes (eg
> Shutdown, Restart, Logoff) to the date/time stamps in the respective
> scripts?
>
> BTW, I get a VBScript runtime error in line 3 of StartTime.vbs:
>
> ActiveX component can't create object 'Scripting.FileSystemObject'
> Code: 800A01AD
>
> Does this mean that I am missing some component or that my permissions
> are set incorrectly?
>
> - Franc Zabkar
> --
> Please remove one 'i' from my address when replying by email.
Shutdown line represent whether shutdown, restart or logoff. But I don't see
the need, and it makes further coding of uptime calculations fairly more
complicated. As for your error, I can't say for sure, but it wouldn't hurt
to reinstall VB runtimes. http://support.microsoft.com/kb/290887/ But it may
be that you have some protective settings or utility getting in the way.
That IS the main drawback of an app based upon scripts.
You might also reinstall the Windows Scripting Host. Last version is 5.6
(SCR56EN.EXE) but you can't find it at MS anymore, so here's a copy:
http://grystmill.com/shared/scr56en.exe
In case the other download also causes problems,
http://grystmill.com/shared/vbrun60sp6.exe
or http://grystmill.com/shared/vbrun60sp5.exe
--
Gary S. Terhune
MS-MVP Shell/User
www.grystmill.com
"Franc Zabkar" <fzabkar@iinternode.on.net> wrote in message
news:bgik041uuqgcpc3iqnjcu48qgmnp7h97no@4ax.com...
> On Fri, 18 Apr 2008 15:06:16 -0700, "Gary S. Terhune" <none> put
> finger to keyboard and composed:
>
>>No, I'll post the code here, between lines of asterisks.
>>
>>"StartTime.vbs"
>>****************************
>>Option Explicit
>>Dim fso, f
>>Set fso = CreateObject("Scripting.FileSystemObject")
>>Set f = fspenTextFile("C:\uptime.txt", 8, True)
>>f.WriteLine "Start " & now
>>f.Close
>>WScript.Quit
>>******************************
>>
>>"Shutdown.vbs"
>>*****************************
>>Option Explicit
>>Dim fso, f, wso
>>Set wso = WScript.CreateObject("WScript.Shell")
>>Set fso = CreateObject("Scripting.FileSystemObject")
>>Set f = fspenTextFile("C:\uptime.txt", 8, True)
>>f.WriteLine "Shutdown" & now
> ^^^^^^^^^^^^
>
>>f.Close
>>wso.run "C:\WINDOWS\RUNDLL32 SHELL32.DLL,SHExitWindowsEx 9"
>>********************************
>
> I'm no programmer, but have you forgotten to add explanatory notes (eg
> Shutdown, Restart, Logoff) to the date/time stamps in the respective
> scripts?
>
> BTW, I get a VBScript runtime error in line 3 of StartTime.vbs:
>
> ActiveX component can't create object 'Scripting.FileSystemObject'
> Code: 800A01AD
>
> Does this mean that I am missing some component or that my permissions
> are set incorrectly?
>
> - Franc Zabkar
> --
> Please remove one 'i' from my address when replying by email.