RaiNote Posted May 31, 2015 Share Posted May 31, 2015 Hello :3How to make that an Script start another special Script which can only be started through this other script not manual The 2 Scripts are compiled but only the main can be started manual.The other must be started through the other and can't be started manual but if it gets that the main Programm gets closed it will instantly close.And If in the 2nd Script is an Array how can that be loaded through the first Script?I hope i formulated it well to understand ^-^.Thanks.P.S: A Cat loves fish. C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2015 Developers Share Posted May 31, 2015 (edited) Shell script2 with an expected commandline parameter which contains the initial scripts PID and keep on monitoring that during execution of script2.Simply exit script2 in case this expected commandline parameter isn't there. Jos Edited May 31, 2015 by Jos 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...
RaiNote Posted May 31, 2015 Author Share Posted May 31, 2015 But How would this command line look and at all i don't get all of it.^^ C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
Bowmore Posted May 31, 2015 Share Posted May 31, 2015 This very basic example shows one method. It's not 100% but for someone to start the second script manually they would have to know the key value and know you were using this method.;Script 1 $key = '{B9E447D4-1706-419A-8077-007D39897225}' Run('C:\code\test\script2.exe ' & $key) While 1 Sleep(10) wend ;Script 2 $key = '{B9E447D4-1706-419A-8077-007D39897225}' If $CmdLine[0] < 1 Then Exit ; No key provided If $CmdLine[1] <> $key = '{B9E447D4-1706-419A-8077-007D39897225}' Then Exit ; Invalid key provided While 1 Sleep(10) wend "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
RaiNote Posted May 31, 2015 Author Share Posted May 31, 2015 Oh thank you very much so it was that easy :o.Ima stupid cat :3 C++/AutoIt/OpenGL Easy Coder I will be Kind to you and try to help you till what you want isn't against the Forum Rules~ Link to comment Share on other sites More sharing options...
water Posted May 31, 2015 Share Posted May 31, 2015 Shouldn't this lineIf $CmdLine[1] <> $key = '{B9E447D4-1706-419A-8077-007D39897225}' Then Exit ; Invalid key providedreadIf $CmdLine[1] <> $key Then Exit ; Invalid key provided My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Developers Jos Posted May 31, 2015 Developers Share Posted May 31, 2015 (edited) Add the PID like this:Run('C:\code\test\script2.exe ' & $key & " " & @AutoItPID).. and add something like this to your second scriptAdlibRegister("Check_Parent",1000) Func Check_Parent() If Not ProcessExists($CmdLine[2]) then Exit EndFuncJos Edited May 31, 2015 by Jos 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...
Bowmore Posted May 31, 2015 Share Posted May 31, 2015 Shouldn't this lineIf $CmdLine[1] <> $key = '{B9E447D4-1706-419A-8077-007D39897225}' Then Exit ; Invalid key providedreadIf $CmdLine[1] <> $key Then Exit ; Invalid key provided It most certainly should. "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook 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