My application uses the following code to run a batch file.
The code above was simplified for readability.
It essentially opens a command window and the batch file runs. In this case the batch file is simply copying a file from a location on the local machine to a writable share on the network. I have checked the share and security is set so that Everyone has full access (read/write/delete/etc - all the boxes are checked). If I open a cmd window and run the batch file it works perfectly. But when the above code runs the batch file the copy function gets "Permission Denied"
Any clues what I am doing wrong here?
Could it have anything to do with useshellexecute ?
Code:
Dim DOSProc As New Process
With DOSProc
.StartInfo.UseShellExecute = False
.StartInfo.FileName = "c:\scripts\copyimages.bat"
.StartInfo.Arguments = Chr(34) & PPSParam.LatestImageFile & Chr(34) & " " &
Chr(34) & PPSParam.Panelname & Chr(34) & " " &
Chr(34) & PPSParam.Comment & Chr(34)
.StartInfo.ErrorDialog = False
.StartInfo.WorkingDirectory = "c:\scripts"
.StartInfo.CreateNoWindow = True
.Start()
End With
It essentially opens a command window and the batch file runs. In this case the batch file is simply copying a file from a location on the local machine to a writable share on the network. I have checked the share and security is set so that Everyone has full access (read/write/delete/etc - all the boxes are checked). If I open a cmd window and run the batch file it works perfectly. But when the above code runs the batch file the copy function gets "Permission Denied"
Any clues what I am doing wrong here?
Could it have anything to do with useshellexecute ?
Comment