lyledg Posted September 28, 2004 Share Posted September 28, 2004 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 Link to comment Share on other sites More sharing options...
nobby Posted September 28, 2004 Share Posted September 28, 2004 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 Link to comment Share on other sites More sharing options...
kkd1 Posted September 28, 2004 Share Posted September 28, 2004 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.OnExitFunccode hereendFuncSorry 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 Link to comment Share on other sites More sharing options...
lyledg Posted September 28, 2004 Author Share Posted September 28, 2004 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.... Link to comment Share on other sites More sharing options...
Developers Jos Posted September 28, 2004 Developers Share Posted September 28, 2004 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.... SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
t0ddie Posted September 28, 2004 Share Posted September 28, 2004 (edited) look in the forum for function stayalive()that code will also do what you want.you need to use the adlib functioni have used that many times already.. and it has solved alot of issues for me.HERE.. i posted it herehttp://www.autoitscript.com/forum/index.php?showtopic=5090 Edited September 28, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
lyledg Posted September 28, 2004 Author Share Posted September 28, 2004 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.... Link to comment Share on other sites More sharing options...
t0ddie Posted September 28, 2004 Share Posted September 28, 2004 (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 September 28, 2004 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
MHz Posted September 28, 2004 Share Posted September 28, 2004 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 Link to comment Share on other sites More sharing options...
lyledg Posted September 28, 2004 Author Share Posted September 28, 2004 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... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now