Busturdust Posted July 22, 2015 Share Posted July 22, 2015 (edited) Hi all, I am trying to create a directory, give everyone full access to the directory (and exe within), and then make a shortcut to the .exe to the Startup Folder for Windows, so that all users launch this application on startup.However, my ICACLS cmd works just fine through the cmd, it is not taking through Autoit, for what I can only guess is a white space issue. I have not been able to figure this one out yet, as it was working on my personal machine, but at work this morning, no go :(. Please see code below. if $arch = "X64" Then $dir_path = "C:\Program Files (x86)\OneTouch" $app_path = $dir_path&"\OneTouch_Locator_64.exe" FileDelete(@MyDocumentsDir&"\OneTouch_Locator_32.exe") DirCreate($dir_path) FileMove(@MyDocumentsDir&"\OneTouch_Locator_64.exe",$app_path ) $command = "icacls "&$dir_path&" /grant Users:(OI)(CI)F /T" consolewrite($command) $Pid = Run( $command ) ProcessWaitClose($Pid) FileCreateShortcut($app_path,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\OneTouch_Locator_64.exe") Edited July 22, 2015 by Busturdust Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 22, 2015 Moderators Share Posted July 22, 2015 Why not try something like this, so you can keep the window open and see the output?Run(@ComSpec & " /k " & $command, "", @SW_SHOW) "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...
Busturdust Posted July 22, 2015 Author Share Posted July 22, 2015 Thanks for the input JLogan, it appears the string was fine and that the ultimate issue was an inconsistency between machines. For some reason, at work the following line/grant Users:(OI)(CI)F /T"Needs to be replaced with /grant Users:(OI)(CI)(F) /T"Even though an explicit CMD execution with the 1st, works, it does not work trhough AutoIT for me. 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