.vbs script giving error - TechRepublic
Question
May 26, 2009 at 09:05 AM
2blueuk

.vbs script giving error

by 2blueuk . Updated 17 years ago

Hi,

Recently, when staying behind after work to perform routine maintenance on client PC’s was getting a bit too much (especially in this season 😉 I created a simple batch file to run basic maintenance programs, a cleaner, virus scan, do windows updates, then defragment (multiple drives on some instances) and fianlly shut down….
I scheduled it to run once a month with task scheduler.
After the Test phase unbelievably only 1 pc mucked up with a simple network issue nothing that cant be fixed.
So I though, I already have a excellent working batch file, why dont i add a line to it (typically at the beginning) to automatically create a restore point before the batch file proceeds with the rest of the script…you never know when it can help.
Googled around a bit and searched techrepublic.com too couldnt find a .bat file to do the job but there were a lot of .vbs scripts. Anyways maybe i cant add it to my maintenance.bat but I can make a seperate vbs file and write an entry in my bat file to point it to the vbs fie, make the bloody restore point and go through the rest of the process…..simple!
Or is it? One script to do the job I found on this site was:

Set IRP = getobject(“winmgmts:\\.\root\default:Systemrestore”)

MYRP = IRP.createrestorepoint (“Restore Point”, 0, 100)

I tried copy and paste, I tried writing it manually, it always gives me the same error:

Script: C:\RP.vbs
Line: 1
Char: 1
Error: 0x80041002
Code: 80041002
Source: (null)

Does anyone know why I keep getting this? Or knows a way around it, I tried nearly every script I found on google none works for me.

Any help appreciated.

This discussion is locked

All Comments