Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WScript Object missing

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WScript Object missing
  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 >>
 WScript Object missing - 10/27/2008 4:46:52 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
Hi i've searched though the forum for an answer to my question but didn't find it.
Since 3 days i work with VBS and i must create an application where one can select more files (with a Browse File Dialog) and save them as "path list" in a .ini file...so it's no web application.

I've been looking for some examples and i've fond them.. as i wanted to compile one of them, the Dialog Box opens, but when i close it i got a runtime error (Expected Object: WScript) 'cause of "WScript.Quit".
My code:

      

This is the easier example that i have..but the others need also this Object as there are instructions like:
- WScript.CreateObject("Shell.Application")
- Wscript.Stdin.Readline
- WScript.Echo

A friend of mine said that maybe some dlls are missing, another one said that maybe that's a "Rights" problem..but i'm logged as admin and i already run the command: regsvr32 VBScript but all is like at the beginning.

If anyone has an idea, would be appreciate :)

thank you in advance!

Regards,
Al

< Message edited by SystematicChaos -- 10/27/2008 4:48:48 AM >
 
 
Post #: 1
 
 RE: WScript Object missing - 10/27/2008 5:08:54 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
Well, I tested it and it worked fine. Have you tried uninstalling/re-installing the WSH?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SystematicChaos)
 
 
Post #: 2
 
 RE: WScript Object missing - 10/27/2008 5:34:01 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
quote:


Well, I tested it and it worked fine. Have you tried uninstalling/re-installing the WSH?


i did it....it says the same thing...

< Message edited by SystematicChaos -- 10/27/2008 5:36:59 AM >

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: WScript Object missing - 10/27/2008 5:37:03 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
It is giving you that error on this line?

WScript.Quit

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SystematicChaos)
 
 
Post #: 4
 
 RE: WScript Object missing - 10/27/2008 5:40:27 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
yes..have you ever seen something similar?

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: WScript Object missing - 10/27/2008 5:48:34 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
I don't recall anything similar. Could you post the rest of your code? I can't think what bearing it may have, but like I say I ran the sub that you posted with no problem whatsoever.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SystematicChaos)
 
 
Post #: 6
 
 RE: WScript Object missing - 10/27/2008 6:00:49 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
the rest of the code works 'cause it doesn't use wscript methods...and there's some functions that are dedicated to a system which i work with...
but anyway i created a new vbs file with only the code i sent before...the popup box. and it doesn't work.

even if i copy it in VB it gives an error and the debug stops at Wscript.Quit line

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: WScript Object missing - 10/27/2008 6:07:27 AM   
  ebgreen


Posts: 5251
Score: 31
Joined: 7/12/2005
Status: offline
Well VB definitely stop at that. How exactly are you running this? Are you saving it as a .vbs file then double clicking it?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SystematicChaos)
 
 
Post #: 8
 
 RE: WScript Object missing - 10/27/2008 6:10:40 AM   
  ehvbs

 

Posts: 2224
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi SystematicChaos,

how do you start your script? I ask, because the WScript object is make available
by the cscript/wscript scripting hosts and Excel - or any other host - must fail.

Regards

ehvbs

(in reply to SystematicChaos)
 
 
Post #: 9
 
 RE: WScript Object missing - 10/27/2008 6:10:50 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
no i have another application that loads the script and runs it at the beginning..and then the script answers to all events that happen in this application. the file is a .vbs but it could also be a .xxx 'cause there's a pointer on it.

(in reply to ebgreen)
 
 
Post #: 10
 
 RE: WScript Object missing - 10/27/2008 6:14:08 AM   
  ehvbs

 

Posts: 2224
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Looks like this application (testing tool?) doesn't provide a suitable WScript object.
Either find a compatible object/class in that application or rewrite your code to
work without WScript.

(in reply to SystematicChaos)
 
 
Post #: 11
 
 RE: WScript Object missing - 10/27/2008 6:18:26 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
wow
so i'd better start to think to another way to write my code.
how can i open a Browse For File Dialog Box, without the wscripts methods?
i'm not really an expert in vbscript :(

anyway thanks for the answers!

regards,
Al

(in reply to ehvbs)
 
 
Post #: 12
 
 RE: WScript Object missing - 10/27/2008 6:29:42 AM   
  ehvbs

 

Posts: 2224
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Use
CreateObject() instead of WScript.CreateObject()
MsgBox instead of WScript.Echo
FileSystemObject to read/write files
Exit Sub instead of WScript.Quit

(in reply to SystematicChaos)
 
 
Post #: 13
 
 RE: WScript Object missing - 10/27/2008 6:50:07 AM   
  SystematicChaos

 

Posts: 8
Score: 0
Joined: 10/27/2008
Status: offline
wonderful! i'll try this tomorrow morning! Now my eyes are burning and here it's 21 PM...
So, have a nice day ehvbs and ebgreen!!
thanks for your help!

Regards,
Al

(in reply to ehvbs)
 
 
Post #: 14
 
 
 
  

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 >> WScript Object missing 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