If you encounter task scheduler try to run your vbs task which involve action on network drive but fail. Besides looking at security permission, please also check the following setting shows on the picture below. Make sure is "Run only when user is logged on". If you choose the "Run whether user is logged on or not", you might not run your task with the intended user and thus fail.
Showing posts with label windows 2008. Show all posts
Showing posts with label windows 2008. Show all posts
Thursday, August 6, 2009
Wednesday, July 22, 2009
Script for event log backup
Simple script to do the event log backup using wevtutil, this is an unpolished script, please use it with care. wevutil is supported on Windows 2008 and Windows Vista.
'Backup event log script
'Get the current date and time
CurrentDate = now
sAcceptableChars = "abcdefghijklmnopqrstuvwxyz0123456789"
'Remove "/", ":", " " from CurrentDate and put it
'in FixDate
For x = 1 to Len(CurrentDate)
ch = mid(CurrentDate, x, 1)
If InStr(sAcceptableChars, LCase(ch)) > 0 Then
FixDate = FixDate & ch
End If
Next
Set wshShell = WScript.CreateObject ("WSCript.shell")
'Start to do event log backup
wshshell.run "C:\Windows\System32\wevtutil cl _
Application /bu:E:\AppEvent_" & FixDate & ".evt", 1, True
wshshell.run "C:\Windows\System32\wevtutil cl Security _
/bu:E:\SecurityEvent_" & FixDate & ".evt", 1, True
wshshell.run "C:\Windows\System32\wevtutil cl Setup _
/bu:E:\SetupEvent_" & FixDate & ".evt", 1, True
wshshell.run "C:\Windows\System32\wevtutil cl System _
/bu:E:\SystemEvent_" & FixDate & ".evt", 1, True
set wshshell = nothing
'Get the current date and time
CurrentDate = now
sAcceptableChars = "abcdefghijklmnopqrstuvwxyz0123456789"
'Remove "/", ":", " " from CurrentDate and put it
'in FixDate
For x = 1 to Len(CurrentDate)
ch = mid(CurrentDate, x, 1)
If InStr(sAcceptableChars, LCase(ch)) > 0 Then
FixDate = FixDate & ch
End If
Next
Set wshShell = WScript.CreateObject ("WSCript.shell")
'Start to do event log backup
wshshell.run "C:\Windows\System32\wevtutil cl _
Application /bu:E:\AppEvent_" & FixDate & ".evt", 1, True
wshshell.run "C:\Windows\System32\wevtutil cl Security _
/bu:E:\SecurityEvent_" & FixDate & ".evt", 1, True
wshshell.run "C:\Windows\System32\wevtutil cl Setup _
/bu:E:\SetupEvent_" & FixDate & ".evt", 1, True
wshshell.run "C:\Windows\System32\wevtutil cl System _
/bu:E:\SystemEvent_" & FixDate & ".evt", 1, True
set wshshell = nothing
Friday, July 25, 2008
Enable Telnet in Windows Vista
I seldom use my own laptop for office work until today when i need to use it to telnet to some equipment to shutdown and to my surprise, there is no Telnet for my laptop which is running Windows Vista. Luckily this feature is disable but not taken away. To enable back, simply go to Control Panel -> Programs and Features -> Turn Windows features on or off. A windows will pop up and from the list, just click the Telnet Client and that's it, you have your telnet back. :)
Subscribe to:
Posts (Atom)
