I have a stand alone windows VB.NET application on a Windows XP machine that I'm trying to get to run a batch file on a remote server. I'm using system.diagnostics.start to run the batch file.
The batch file is setup to use paths such as "set PFDATA=\\servername\c$\appl" etc.
I've setup a service acct of "filepro" to use when running the VB.NET application.
If I give "filepro" Domain Admin rights, then the application runs the batch file. However, I don't want to give "filepro" Domain Admin rights. I'd like to give him Domain User rights and then modify the folder's share/security permissions on the W2K3 server.
I don't want to use mapped drives due to the fact that if the application crashes, the mapped drives won't be disconnected from the users computer.
I've shared, and given "filepro" full control over the paths in the batch file plus the "\\servername\c$\windows" folder (for cmd.exe ?).
The program fails with a "System.ComponentModel.Win32Exception: Access is Denied"
Here is the batch file:
And here is the applicable portion of the .net application:
Private Sub StartBtn_Click ...
Dim fp As Diagnostics.Process = New Diagnostics.Process
fp.StartInfo.UserName = "filepro"
fp.StartInfo.Domain = Environment.UserDomainName.ToString
Dim spwd As New System.Security.SecureString
Dim pwd As String = "********"
Array.ForEach(pwd.ToCharArray(), AddressOf spwd.AppendChar)
fp.StartInfo.Password = spwd
fp.StartInfo.FileName = "\\servername\c$\FP_Logins\User_Update.bat
fp.StartInfo.UseShellExecute = False
fp.StartInfo.CreateNoWindow = False
fp.Start() '<<<Fails here>>>