Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Hello

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,63560
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Hello
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Hello - 8/18/2008 2:11:16 AM   
  Vice26

 

Posts: 11
Score: 0
Joined: 8/18/2008
Status: offline
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?

Line:26
Error: Object required:'WScript'"
[yes] [no]

This is the code from the 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

end sub

I have registered SCRRUN.DLL and WSHOM.OCX, i have tried with LOW SECURITY LEVEL. Nothing helped. What could it be?
 
 
Post #: 1
 
 RE: Hello - 8/18/2008 2:14:21 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
Need more code.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Vice26)
 
 
Post #: 2
 
 More code - 8/18/2008 2:22:43 AM   
  Vice26

 

Posts: 11
Score: 0
Joined: 8/18/2008
Status: offline
This is from HTM file:

<script id=clientEventHandlersVBS language="VbScript" src="images/gd-vbs/gdrut-vbs1.vbs">
<!--

-->
</script>
This is the code with the button:

<p><input type="button" value="OK" name="cmdButonOK" id="cmdButtonOK"></p>

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

end sub

(in reply to Vice26)
 
 
Post #: 3
 
 RE: More code - 8/18/2008 2:33:25 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
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.


      

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Vice26)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Hello Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts