jamesrandi Posted March 15, 2008 Share Posted March 15, 2008 Hi everyone! first off i will only use this script for private purposes - i wont send it to anyone. I need a script that i will put in my autostart. it has to run a specific .exe and immediately hide it from the taskbar, so people cannot see it (it can appear in taskmanager tho, i dont care about that). Ill just call that .exe "program1" for now. the thing is, that the program1 will automatically close if program2 is being run.. so it needs to be started again by the script, when program2 is being closed. this might sound complicated at first but infact its quite simple. i just need to hide the program1 from any other people and still having it running so my primary question is, is it possible to hide a program completely from the taskbar etc with autoit3? and how? thanks alot to anyone who tries to help me Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 15, 2008 Moderators Share Posted March 15, 2008 #NoTrayIcon Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Oldwilly Posted March 15, 2008 Share Posted March 15, 2008 I ain't sure if that can apply to your needs but if you create your program inside a GUI with http://www.autoitscript.com/autoit3/docs/f...s/GUICreate.htm then you can hide or show it with GUISetState and @SW_SHOW or @SW_HIDE values.. Link to comment Share on other sites More sharing options...
ChrisL Posted March 15, 2008 Share Posted March 15, 2008 Something like this? HotkeySet("{esc}","_quit") While 1 $iPid Run("Program1.exe","".@SW_HIDE) While ProcessExists($iPid) Sleep(250) WEnd While ProcessExists("Process2.exe") Sleep(250) WEnd WEnd Func _quit() Exit EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
jamesrandi Posted March 15, 2008 Author Share Posted March 15, 2008 Thanks to anyone so far, i got the basics of the code i need now But, is there any way to let the script check if a process is being closed? cause i need to run the program1 again immediately if the program2 is being shut down. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 15, 2008 Moderators Share Posted March 15, 2008 OnAutoItExit Anymore information than that is typical of malware type. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ChrisL Posted March 15, 2008 Share Posted March 15, 2008 Thanks to anyone so far, i got the basics of the code i need now But, is there any way to let the script check if a process is being closed? cause i need to run the program1 again immediately if the program2 is being shut down.What I wrote does that, you just need to know what the process is called for Program2, it's in a loopYou run Program1, it loops until program2 closes it, then it loops while program2 is running then when program2 exits it goes back to the beginning and launches program1 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
jamesrandi Posted March 16, 2008 Author Share Posted March 16, 2008 What I wrote does that, you just need to know what the process is called for Program2, it's in a loop You run Program1, it loops until program2 closes it, then it loops while program2 is running then when program2 exits it goes back to the beginning and launches program1 oh - thank you, gotcha now well, i worked my own code out and it works like a charm now (might look a bit inconvenient in your eyes but its fine for me) #NoTrayIcon ProcessSetPriority ( "script.exe" , 0 ) If ProcessExists ( "program1.exe" ) Then ProcessClose ( "program1.exe" ) EndIf Sleep (250) Run ("program2.exe" , "" , "@SW_HIDE") ProcessWait ( "program2.exe" ) If ProcessExists ( "program2.exe" ) Then ProcessWaitClose ( "program2.exe" ) EndIf Run ( "script.exe" ) thank u all =] Link to comment Share on other sites More sharing options...
JustinReno Posted March 16, 2008 Share Posted March 16, 2008 (edited) This looks better: #NoTrayIcon ProcessSetPriority("Script.exe", 0) If ProcessExists("Program1.exe") Then ProcessClose("Program1.exe") Sleep (250) Run("Program2.exe", "" , "@SW_HIDE") ProcessWait("Program2.exe") If ProcessExists("Program2.exe" ) Then ProcessWaitClose("Program2.exe") Run("Script.exe") Edited March 16, 2008 by JustinReno Link to comment Share on other sites More sharing options...
Tomb Posted March 16, 2008 Share Posted March 16, 2008 This looks better: #NoTrayIcon ProcessSetPriority("Script.exe", 0) If ProcessExists("Program1.exe") Then ProcessClose("Program1.exe") Sleep (250) Run("Program2.exe", "" , "@SW_HIDE") ProcessWait("Program2.exe") If ProcessExists("Program2.exe" ) Then ProcessWaitClose("Program2.exe") Run("Script.exe") where are your EndIf's ? Link to comment Share on other sites More sharing options...
NELyon Posted March 16, 2008 Share Posted March 16, 2008 (edited) where are your EndIf's ?He doesn't need them EDIT: To clarify, he doesn't need them because it is a single line IF statement. Edited March 16, 2008 by Senton-Bomb Link to comment Share on other sites More sharing options...
Tomb Posted March 16, 2008 Share Posted March 16, 2008 He doesn't need them EDIT: To clarify, he doesn't need them because it is a single line IF statement.AH1-800-AUT-OIT3 Would be the coolest # Ever Link to comment Share on other sites More sharing options...
JustinReno Posted March 16, 2008 Share Posted March 16, 2008 AH1-800-AUT-OIT3 Would be the coolest # Ever That was random. Link to comment Share on other sites More sharing options...
Tomb Posted March 16, 2008 Share Posted March 16, 2008 That was random.yeah i agreei just copied it from the text under sentons avatar Link to comment Share on other sites More sharing options...
ChrisL Posted March 16, 2008 Share Posted March 16, 2008 (edited) I need a script that i will put in my autostart. it has to run a specific .exe and immediately hide it from the taskbar, so people cannot see it (it can appear in taskmanager tho, i dont care about that). Ill just call that .exe "program1" for now. the thing is, that the program1 will automatically close if program2 is being run.. so it needs to be started again by the script, when program2 is being closed. oh - thank you, gotcha now well, i worked my own code out and it works like a charm now (might look a bit inconvenient in your eyes but its fine for me) #NoTrayIcon ProcessSetPriority ( "script.exe" , 0 ) If ProcessExists ( "program1.exe" ) Then ProcessClose ( "program1.exe" ) EndIf Sleep (250) Run ("program2.exe" , "" , "@SW_HIDE") ProcessWait ( "program2.exe" ) If ProcessExists ( "program2.exe" ) Then ProcessWaitClose ( "program2.exe" ) EndIf Run ( "script.exe" ) thank u all =] Well thats not what you said.. Run program1, then when program2 runs program1 automatically closes then when program2 finishes you want to re-run program1 What you wrote is the total reverse of what you asked at the top Edited March 16, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
jamesrandi Posted March 16, 2008 Author Share Posted March 16, 2008 Well thats not what you said.. Run program1, then when program2 runs program1 automatically closes then when program2 finishes you want to re-run program1What you wrote is the total reverse of what you asked at the topits not, i think u just got me wrong - the point is, that program2 automatically closes program1 itself. whatever, it worked now and u guys helped me a lot. didnt do any autoit in ages :} 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