sud Posted March 7, 2016 Share Posted March 7, 2016 I am trying to run .exe file from a network folder. but not getting any response. Also tried with mapping the drive. using below code. Method 1 : Run("\\.exe path") Method 2 : $result = FileExists("\\.exe path") If $result Then Msgbox(0,"","File exists") Run("\\.exe path") Else Msgbox(0,"","File doesn't exist") EndIf Method 3: DriveMapAdd("X:", "\\ path") RunAs("X:\.exe") Thanks Sud Link to comment Share on other sites More sharing options...
rudi Posted March 7, 2016 Share Posted March 7, 2016 Hi. This should give you a start: $Exe="\\server\share\notepad.exe" if FileExists($Exe) Then $PID=run($Exe,@TempDir) MsgBox(0,"EXE File found","The Program " & $Exe & " has been started with PID=" & $PID) Else MsgBox(48,"EXE not found","The Program " & $Exe & " doesn't seem to exist. (missing rights?)") EndIf Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
sud Posted March 8, 2016 Author Share Posted March 8, 2016 Hi rudi, thanks for your inputs. i have tried the same and the msg is displaying that program has been started with PID but .exe is still not executing. Link to comment Share on other sites More sharing options...
Juvigy Posted March 8, 2016 Share Posted March 8, 2016 (edited) Maybe something with admin rights? Do you have #requireadmin in your script? @edit: Have you tried to start it manually - doest it work ? Try shellexecute instead of RUN. Edited March 8, 2016 by Juvigy spel check sud 1 Link to comment Share on other sites More sharing options...
sud Posted March 9, 2016 Author Share Posted March 9, 2016 @Juvigy thanks shellexecute solved the issue. 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