field2network Posted September 22, 2014 Share Posted September 22, 2014 Hi, after months of not using and not learning AutoIT (yes, I regret this ) as I wrote enough batch scripts with a length at least one time around the world I now have a big problem with a very special installation routine that forces me to sleepless nights. Of course I could spend more hours here to search and pick up all informations necessary, which ist what I actually did. But I am running out of time slowly. So I would kindly ask for help and a script example to solve my little problem. These are the steps which the installation should make: 1.) AutoIT should prompt user to close Microsoft Outlook 2013 with a yes/no button; if yes is selected, the script should go on, if no is the choice, the script should Exit 2.) After clicking "yes" the script should FORCE Outlook to close. 3.) After terminating Outlook, a net use command with different user rights (function user) should copy 3 pictures from a network share to the public user home folder, after that the installer itself which is one Level deeper inside the share. This single file should only be temporary. 4.) The user should be informed that he may not take any keystrokes. The second possibility is to prevent the user from any input 5.) The installer file is an *.exe . Unfortunally, there are NO command line options, so I have to use the AutoIT window script to click "next" and "finish" automatically. Of course, for that Installation is a run as command necessary. 6.) After finishing the Installation, a *.reg file has to be copied from the same network share and be executed silently. 7.) Now the mapped share should be deleted 8.) The user should get an information button that the Installation was successfull. After clicking "OK", Outlook should be started. My biggest problem is how to set up the user interface and the parameters to terminate Outlook and execute the installer. I already tried some code-snipplets, so I got a elevated command prompt running, but after the status message is displayed and gone (timeout), the keystrokes for mapping the network share runs into Scite. I expect that this particular problem is much easier as I expect, but I really need fast help. It would be great if someone out here could share a few minutes for my code snipplets. Many thanks in advance, best regards, Sven Link to comment Share on other sites More sharing options...
j0kky Posted September 22, 2014 Share Posted September 22, 2014 Write your code here, so we can help you Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
field2network Posted September 22, 2014 Author Share Posted September 22, 2014 My problem is that I have no idea how to set up the user interface as I have never done this before. MsgBox (4096, "Outlook has to be closed",60) RunAs ("Administrator", "MYDOMAIN", "MYPASSWORD", 2, "cmd.exe") send "net use I: 192.168..... "PASSWORD" /user: MYDOMAINuser I am not sure how to go on with this script. Any idea? Any example? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 22, 2014 Moderators Share Posted September 22, 2014 1.) AutoIT should prompt user to close Microsoft Outlook 2013 with a yes/no button; if yes is selected, the script should go on, if no is the choice, the script should Exit 2.) After clicking "yes" the script should FORCE Outlook to close. 3.) After terminating Outlook, a net use command with different user rights (function user) should copy 3 pictures from a network share to the public user home folder, after that the installer itself which is one Level deeper inside the share. This single file should only be temporary. 4.) The user should be informed that he may not take any keystrokes. The second possibility is to prevent the user from any input 5.) The installer file is an *.exe . Unfortunally, there are NO command line options, so I have to use the AutoIT window script to click "next" and "finish" automatically. Of course, for that Installation is a run as command necessary. 6.) After finishing the Installation, a *.reg file has to be copied from the same network share and be executed silently. 7.) Now the mapped share should be deleted 8.) The user should get an information button that the Installation was successfull. After clicking "OK", Outlook should be started. 1.) You have it correct already, a MsgBox. 2.) Then (pseudo) If Msgbox = OK/Yes, ProcessClose Outlook, Else Exit 3.) ShellExecuteWait or RunWait net use <parameters> 4.) MsgBox, then BlockInput 5.) RunWait or ShellExecuteWait installation executable. 6.) RegWrite or Run regedit.exe silently 7.) DriveMapDel 8.) Msgbox. Now, show us what you can try on your own "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
j0kky Posted September 22, 2014 Share Posted September 22, 2014 Just a little correction on point 2: you have to use RunAsWait("USERNAME", "DOMAIN", "PASSWORD", 2, @ComSpec & " /c " & 'commandName') and don't type user and password in commandname Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
field2network Posted September 22, 2014 Author Share Posted September 22, 2014 Ok, I understand everything after the yes/no choice. But I regret that I do not know how to use the query correctly. (Sorry, I am not familiar with AutoIT and scripting language outside of the Microsoft world yet) So MsgBox(4148,"","",60) if.... Here I have to stop. Could you provide me how to use the correct Syntax "if", "then" and "else" with the yes/no buttons? Thanks in advance! Link to comment Share on other sites More sharing options...
j0kky Posted September 22, 2014 Share Posted September 22, 2014 (edited) $choice = MsgBox(4096 + 48 + 4,"","",60) If $choice = 6 Then ConsoleWrite("Yes" & @CRLF) Else ConsoleWrite("No" & @CRLF) EndIf Edited September 22, 2014 by j0kky Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs 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