PDA

View Full Version : File.Run problem


Harris
03-26-2007, 05:20 AM
I have used the following code to run an installation program from a subdirectory on a cd. However, it will not activate the file, "SetupAdvisor.exe". I cannot fathom out why - is there a problem with the code?

File.Run("_SourceDrive\\Advisor\\SetupAdvisor.exe", "", "_SourceDrive\\Advisor", SW_SHOWNORMAL, false);

Thanks for any help.

Regards,
Harris

RizlaUK
03-26-2007, 06:02 AM
you have the quotes in the wrong place

File.Run("_SourceDrive\\Advisor\\SetupAdvisor.exe" , "", "_SourceDrive\\Advisor", SW_SHOWNORMAL, false);

try this

File.Run(_SourceDrive.."\\Advisor\\SetupAdvisor.exe" , "", _SourceDrive.."\\Advisor", SW_SHOWNORMAL, false);

also if you want to accesss the folder the app is run from use _SourceFolder instead of _SourceDrive

Harris
03-26-2007, 07:02 AM
Thanks, the correct fix! Much appreciated, and for such a quick response.
Harris