In my application, I am passing some command line arguments to schedule a task.
str is a string which after some operations becomes
/create /tn StartIE /tr "C:\Program Files\Internet Explorer\iexplore.exe http://abc.com" /sc onlogon
And then I start a process as:
ProcessStartInfo ps = ProcessStartInfo("schtasks");
ps.Arguments = str;
Process.Start(ps);
When I look into the task scheudler for the scheduled tasks, I get Action of schedules task as:
C:\Program
and the Arguments as: Files\Internet Explorer\iexplore.exe http://abc.com
So, the problem is because of the space in Program Files. How should I correct thing thing, so that the actual program remains
C:\Program Files\Internet Explorer\iexplore.exe http://abc.com
and Arguments = http://abc.com
?