Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Question RE Pausing in HTA

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Question RE Pausing in HTA
  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 >>
 Question RE Pausing in HTA - 5/7/2008 5:16:55 AM   
  chiltz

 

Posts: 62
Score: 0
Joined: 6/13/2007
Status: offline
HI Guys,

I am using pausing in an HTA.  I have a sleep function setup and I also have a setinterval function setup for pausing the HTA.  Both have disadvantages.  If I could get around the disadvanage of either one, I don't really care which one I use.  In the first code block I am using a function called "sleep" to pause the script, problem is it doesn't work...it runs the sub and then goes to the next line of code before its done the sub.  In the second code block, I am using the setinterval command, which does work.  Problem is I have to create a sub to run more code each time a want to pause the script, and there is going to be alot of times I want to pause the script.  Id rather have one function that I can use repeatedly than creating a new sub for each time I want to pause the script.  Any ideas's?



      



      
 
 
Post #: 1
 
 RE: Question RE Pausing in HTA - 5/7/2008 5:29:06 AM   
  dm_4ever


Posts: 2174
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
Wouldn't you want this line to finish first?

objShell.Run("%comspec% /C c:\psexec.exe \\" & strMachine & " netsh interface ip show config >>" & outputfile)

i.e.
objShell.Run "%comspec% /C c:\psexec.exe \\" & strMachine & " netsh interface ip show config >>" & outputfile, 0, True

If the only reason for the sleep is to wait long enough to read the output file created...that should take care of it. 

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to chiltz)
 
 
Post #: 2
 
 RE: Question RE Pausing in HTA - 5/7/2008 5:44:11 AM   
  chiltz

 

Posts: 62
Score: 0
Joined: 6/13/2007
Status: offline
Desired result is

PROCESS LINE objShell.Run("%comspec% /C c:\psexec.exe \\" & strMachine & " netsh interface ip show config >>" & outputfile)
PROCESS LINE Sleep()
PROCESS LINE AFTER PREVIOUS LINE WORK IS COMPLETE  Set objExec = objShell.Exec("c:\windows\system32\notepad.exe " & outputfile)


What I want to do is write some data to a text file and then open the text file.  As it is right now, the text file is opening before the data is written to the file.  Thus I want to start the process of writing the data, then add a sleep of set amount of time, then open the text file. 

The fix to the problem was adding the "0 , True" to Line "objShell.Run"%COMSPEC% /c ping -n 15 127.0.0.1>nul" in sub "Sleep"  So the script doesn't continue until that run command if finished.  Thanks for the tip DM

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: Question RE Pausing in HTA - 5/7/2008 5:45:24 AM   
  chiltz

 

Posts: 62
Score: 0
Joined: 6/13/2007
Status: offline
just as a side note....when I use that sleep sub..I see no change in CPU Utilization at all.

(in reply to chiltz)
 
 
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 >> Question RE Pausing in HTA 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