Start.process Issue  
Author Message
esaba.keith.cz





PostPosted: Visual C# General, Start.process Issue Top

I am running into a bit of a roadblock with my current project. I am attemtping to create a program that allows user to pick from a selection of software title they want to install, after selecting the software, a vbs script file launches and installs the software with all appropirate switchs (E.G. silent installations etc).

Problem: When the program executes, it finds the VBS file and executes, however, it immediately closes without installing the software. (On a side not, when I double click the .vbs file, everthing works fine)

Any help would be much appreciated.

Thank You

Here is my Main ();

static void Main()

{

// Get the path that stores favorite links.

string pathtoscript =

Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

MyProcess myProcess = new MyProcess();

myProcess.Installsoftware(pathtoscript);

Console.ReadLine(); //wait of user term.

-----------------------------

Install software method.

-------------------------------

void Installsoftware(string pathtoscript)

{

// Launches Silent Installation of application

Process.Start(pathtoscript +"\\test\\test1\\iss.vbs");

}



Visual C#4  
 
 
ahmedilyas





PostPosted: Visual C# General, Start.process Issue Top

could the script have anything to do with the startup directory Try using the ProcessStartInfo class to give it the:

  • path\filename

  • arguments (if any) for that file

  • set the initial/working directory (Startup dir)

    then launch it with Process.Start(theProcessStartInfoObject)

    what happens now

    are you able to place some debug message boxes in the VBS file to see whats happening and at what point it maybe bumming out



  •  
     
    esaba.keith.cz





    PostPosted: Visual C# General, Start.process Issue Top

    Thanks for the help, I was to complete the same thing by using:

    ProcessStartInfo startInfo = new ProcessStartInfo(Pathtoobj + filename+args);

    process.start(Startinfo);

    Thanks for the help.