Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


"can not open vbscript" bypassing?

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> "can not open vbscript" bypassing?
  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 >>
 "can not open vbscript" bypassing? - 7/23/2008 3:15:48 AM   
  Gahzi

 

Posts: 3
Score: 0
Joined: 7/23/2008
Status: offline
Hey Guys,

I am writing a script right now that opens a bunch of other vbs file. These vbs files then open excel files which may or may not work. If they do not work, I have my main script at the beginning send an email to me telling me that xxx failed.

The problem is that when an error occurs, the script will hang until I press enter/click ok. Is there a way to automate this so that I can schedule this script to run and have it not hang? I have tried a bunch of things like KeyEvents and so forth.

Heres an example of the code im using

Set WSHShell =  CreateObject("WScript.Shell")
WSHShell.Run "whatever.vbs", , True
On Error Resume Next
if( Err.Number > 0) then
TBody = TBody & "whatever.vbs-failed"
Err.Clear
else
TBody = TBody & "whatever.vbs-success"
end if

Any Ideas would be appreciated!

 
 
Post #: 1
 
 RE: "can not open vbscript" bypassing? - 7/23/2008 4:40:05 AM   
  Rischip


Posts: 480
Score: 2
Joined: 3/26/2007
Status: offline
If you have access to the scripts change them not to prompt for a button press, or change the statement that uses msgbox or inputbox to use something like .Popup

object.Popup (Message [, TimeOut][, Title] [, Format])



Set WshShell = CreateObject("WScript.Shell")
Result = WshShell.Popup("This is a popup box!", 10, "Title", 65)

This will popup but only delay up to the timeout, in this case 10 seconds.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Gahzi)
 
 
Post #: 2
 
 RE: "can not open vbscript" bypassing? - 7/23/2008 4:50:38 AM   
  Gahzi

 

Posts: 3
Score: 0
Joined: 7/23/2008
Status: offline
Hey thanks for the reply,

Its not the scripts that prompt for the button press, its the compiler that returns an error, which forces my general script to hang and not try to load the other scripts( I would like it to continue on)

Thanks,

Shervin

(in reply to Rischip)
 
 
Post #: 3
 
 RE: "can not open vbscript" bypassing? - 7/23/2008 4:56:06 AM   
  Rischip


Posts: 480
Score: 2
Joined: 3/26/2007
Status: offline
The compiler throws an error? What is the error? You will most definately need to fix the code if you have compiler errors.
On Error Resume Next might work depending on the error, but should investigate why you are getting the error in the first place.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Gahzi)
 
 
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 >> "can not open vbscript" bypassing? 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