PDA

View Full Version : .Vbs script For System restore



tomtomg59
05-23-2011, 05:34 PM
Hello, Using xp home on both pc's I have this script on my 1st pc to make an instant restore point and it works great to do an Instant System Restore but i put it on my 2nd pc and it will not work, it just keeps opening in Notepad. This is the script I am using>>

set SRP = getobject("winmgmts:\\.\root\default:Systemrestore")
CSRP = SRP.createrestorepoint ("Created a Restore Point now", 0, 100)

I put it in Notepad and saved it to all files, why doesn't it work my 2nd pc, I am administrator, I have no virus's, Any idea's" thanks

mjc
05-23-2011, 07:24 PM
Well...a couple of things come to mind.

First, you could have PC #1 (script works) set to show 'known' file extensions and the second machine set not to show them. In the first case, the .vbs shown is the actual extension, where as, on the second machine to true extension is .txt (with that being hidden and .vbs being shown). This is the DEFAULT setup for XP.

Another possibility is that scripting has been disabled on PC #2. This is a common safety measure and some anti-malware/tweaker programs will have it as an option.

tomtomg59
05-24-2011, 09:02 AM
MJC, Thanks, I have the all the show settings correct but you said>>

Another possibility is that scripting has been disabled on PC #2. This is a common safety measure and some anti-malware/tweaker programs will have it as an option.

I only use Microsoft Security Essentials and Malwarebytes now and I think I managed to give the .VBS permission in its settings, but I still cannot get the Script to make a system restore, it just keeps opening in Notepad, instead of creating a restore point.

Anythink else I can try?

mjc
05-24-2011, 10:14 AM
Do any other vbs run on that system?

A third and less common, but still not really rare, way of that happening is to associate the vbs extension with Notepad, so it will always open in Notepad.

Run Regedit and go to the Hkey_Classes_Root key and see what it says under VBSFile. There should be a key ther named Shell. Under Shell there should be one that says Open. What does it say under Command?

If it doesn't say something about WSengine then the association has been changed.

If that's the case, then download the reg file from http://www.dougknox.com/xp/file_assoc.htm named VBS File Association Fix.

tomtomg59
05-24-2011, 12:22 PM
It only states>>> Under Command it says REG_EXPAND_SZ %SytemRoot%\Explorer.exe /idlist,%l,%l

Going to Dougknocx now, will let you know

tomtomg59
05-24-2011, 12:43 PM
MJC. Thank you Very Much, the download at Dougknox worked great.

As I mentioned this is my older second pc (actually my first) and I seem to remember doing something like this years ago.

Do you have any thoughts on what could take this .vbs file association OFF my pc in the first place? (incase it happens again) Thank You

mjc
05-24-2011, 03:04 PM
It was a very popular tweak, several years ago...lots of anti-malware apps offered it as an option.

tomtomg59
05-24-2011, 05:45 PM
mjc, Ok, Thank You Again