ADO DOT NET Posted April 8, 2007 Posted April 8, 2007 Hi, I wanna build 2 exe files: 1. Run.exe 2. secret.exe I want that my user runs Run.exe and then Run.exe executes the secret.exe I mean I want that if user executes the secret.exe directly, he get an error. Because these 2 files are independent, I think I have 2 put a command line switch/parameter in secret.exe and pass it via Run.exe to secret.exe. And secret.exe checks at startup to see if the correct parameter has been passed or not? My 1st question is that how can I check a switch or command line in my program? And 2nd question is that how to pass a switch to this: System.Diagnostics.Process.Start("secret.exe /myParameter") Is that correct? Thanks:) Quote
Administrators PlausiblyDamp Posted April 8, 2007 Administrators Posted April 8, 2007 You can always get the command line passed into your application through Environment.CommandLine To launch another process and pass in a command line use System.Diagnostics.Process.Start("secret.exe", "/myParameter") Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.