Process.Start Question

WellsCarrie

Well-known member
Joined
Jul 12, 2005
Messages
95
Location
Arkansas
Programming Experience
5-10
I have the requirement to run a VBS process to FTP files from our AS400 system. The VBS was written for me and I am not allowed to use any other ftping system. (sys admin rules! :mad:).

That being said I have been tasked with writing an application that will fetch the files, process the data in the files, create two - four new files and ftp them to the SAP server.

To run the process I thought I could do the following:

VB.NET:
        Dim psi As New ProcessStartInfo
        psi.UseShellExecute = True
        psi.FileName = "c:\ARFiles\ARConversionFTP.vbs"
        If Process.Start(psi).HasExited Then
            rtbInfo.AppendText("files fetched.")
        End If

However this only opens the vbs as a text file it does not run it. Anyone have any idea what I missed?
 
You can run cscript.exe/wscript.exe with script as parameter, these can also be used to configure default host for running scripts so they can run like you tried. (this run fine at my pc without any custom config)
 
ok it will run cscript.exe but when I try to have it execute "cscript.exe c:\ARFiles\ArConversionFTP.vbs" the program breaks with the claim it can not find the file. I have triple checked the .vbs path and file name and when I copy the quoted section onto a command line it runs fine.

VB.NET:
        Dim psi As New ProcessStartInfo
        psi.UseShellExecute = True
        psi.FileName = "cscript.exe C:\ARFiles\ARConversionFTP.vbs"
        If Process.Start(psi).HasExited Then
            rtbInfo.AppendText("files fetched.")
        End If

Sorry if I'm being a dunder head. I just can't see what is wrong here.
:confused:
 
Only the executable in Filename, the other is Arguments.
 
Back
Top