Jump to content

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


 Share

Recommended Posts

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

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

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...