I don't know sure if this is the proper place for my problem but i am going to type my vbscript error: I want to accces a specified file through a vbs file code. I've created a vbs file and from my htm i linked to it with scr="[]" line. When executed in IEXPLORER 6.1 an error appears:
"A Runtime Error has occured. Do you wish to debug?
sub cmdButtonOK_onclick() dim WshShell, objFS Set WshShell = WScript.CreateObject("WScript.Shell") Set objFS = CreateObject("Scripting.FileSystemObject") WshShell.Run """%windir%\notepad.exe""",1, true
end sub
I have registered SCRRUN.DLL and WSHOM.OCX, i have tried with LOW SECURITY LEVEL. Nothing helped. What could it be?
and this is the code with the click event to this OK button, in the gdrut-vbs1.vbs file:
sub cmdButtonOK_onclick() dim WshShell, objFS Set WshShell = WScript.CreateObject("WScript.Shell") Set objFS = CreateObject("Scripting.FileSystemObject") WshShell.Run """%windir%\notepad.exe""",1, true
The wscript object doesn't exist in IE until you create it. That is why you are using createobject. Remove the Wscript in front of CreateObject like below.