sud

Pls help, How to Run a .Exe file which is at network folder

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Juvigy
spel check
1 person likes this

Share this post


Link to post
Share on other sites

@Juvigy

thanks shellexecute solved the issue. :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now