Sign in to follow this  
Followers 0
lyledg

Run command after script has finished

10 posts in this topic

Guys..

I have created a gui Logon script using Autoit and trying to call a url AFTER the Autoit script has exicted. I have read up on the "OnExitFunc" Option but have no clue how to implement this in my script...

Is this the way to do it...? Or can something else be suggested?

Cheers

Share this post


Link to post
Share on other sites



You could call another script as the last line in your code

You code
Run("NewScript","")

Or just include

Run("'c:\program files\internet explorer\iexplore.exe' 'http://your url'","")

CheersNobby

Share this post


Link to post
Share on other sites

I think lyledg

means he wants the url to be opend once the script has finished not befor then...

I have never herd of the onExitFunc command... But still you can try to make a Func then have it call that up with the onExitFunc...

e.g.

OnExitFunc

code here

endFunc

Sorry bout the code thingy... I'm using Fast Reply.


Doctors are EVIL!I'll host you your own autoIT script site... If you really want... Email me. SE@gfun.ahazhosting.com and sign up to my website... http://g-institute.r8.org

Share this post


Link to post
Share on other sites

Thanks for the replies guys!

KKD1 is right, I am wanting to launch the URL after the logon script has run...the problem that I have found is because the explorer shell has not yet run at the logon process, when I try and launch the URL through IE, it does not work....

Share this post


Link to post
Share on other sites

Thanks for the replies guys!

KKD1 is right, I am wanting to launch the URL after the logon script has run...the problem that I have found is because the explorer shell has not yet run at the logon process, when I try and launch the URL through IE, it does not work....

<{POST_SNAPBACK}>

Worked on this same issue with somebody a while ago.

The solution was to add a shortcut to the Startup folder with FileCreateShortcut because the explorer is reset at login....


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

look in the forum for

function stayalive()

that code will also do what you want.

you need to use the adlib function

i have used that many times already.. and it has solved alot of issues for me.

HERE.. i posted it here

http://www.autoitscript.com/forum/index.php?showtopic=5090

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Thanks Jdeb

I have already tried the shortcut in the startup folder routine, but the issue I came up against there was once the shortcut had completed it's task in the startup folder, it needed to be removed or deleted...How do I automate this? Basically at logoff the shortcut needs to be removed...I will give T0ddie's suggestion a bash and see where that goes....

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

to self destruct a file, add this to the end.

FileDelete("_____.bat")

$batchFile = 'loop:' & @CRLF & 'del "' & @SCRIPTFULLPATH & '"' & @CRLF &_

'ping -n 1 -w 250 zxywqxz_q' & @CRLF & 'if exist "' & @SCRIPTFULLPATH &_

'" goto loop' & @CRLF & 'del _____.bat' & @CRLF

FileWrite("_____.bat",$batchFile)

Run("_____.bat",@SCRIPTDIR,@SW_HIDE)

i guess you couldnt really add that to a shortcut though.. heh

nevermind

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Instead of creating shortcuts, you could copy the whole autoit file into each startup folder as with Toddies idea.

I also use this method of self-delete file in startup folder.

; YOUR CODE HERE

Delete()

Func Delete()
   FileDelete(@TempDir & "\scratch.cmd")
   $CMDFILE = ':loop' & @CRLF & 'del "' & @ScriptFullPath & '"' & @CRLF & 'if exist "' & @ScriptFullPath & _
         '" goto loop' & @CRLF & 'del ' & @TempDir & '\scratch.cmd' & @CRLF
   FileWrite(@TempDir & "\scratch.cmd", $CMDFILE)
   Run(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)
EndFunc  ;==>Delete

Share this post


Link to post
Share on other sites

Thanks MHZ for the suggestion, but that won't work in this example, as the Autoit script is hosted on a Domain controller, which calls the logon command to map drives etc..

I think I have found the solution, by creating a runonce key in the HKCU hive. Tha seems to be working, but I have to do some more extensive testing...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0