Last post Jul 20, 2017 07:58 PM by sevi
Jul 20, 2017 07:45 PM|sevi|LINK
I need to execute a file on the server via button click. When I run it with a parameter it fails with
The system cannot find the file specified
The file is there and will execute if no param is supplied. Why does the code below fail?
Dim pInfo As New ProcessStartInfo()
dim intParam as integer
intParam = 1
pInfo.FileName ="c:\my path\myfile.exe" + " " + intParam.tostring
Jul 20, 2017 07:54 PM|mgebhard|LINK
The file name is incorrect.
You need to pass a valid file and path to the exe.
pInfo.FileName ="c:\my path\myfile.exe"
arguments property to set input parameters.
Keep in mind the web application will need privileges to execute the exe. Also, it is a bit odd to execute an exe from a web application. What are you trying to do?
Jul 20, 2017 07:58 PM|sevi|LINK
Thank you - the problem will be the argument property, which I haven't had exposure to, this is my first use of ProcessStartInfo().
It's a task that runs on a server, run by admins.