CMD.exe help
-
You can run it in silent mode. ProcessStartInfo i = new ProcessStartInfo(); i.CreateNoWindow = true; i.UseShellExecute = false; i.RedirectStandardError = true; i.FileName = "file to execute"; i.Arguments = (@"arguments"); System.Diagnostics.Process proc = Process.Start(i);
-
Can seem to get this to work, do you mind filling on the "file to execute" and the "arguments" so i have an example.
If command to execute in shell is "FOP.exe -XML abc.xml - pdf abc.pdf" Then file to execute is FOP.exe and arguments are -XML abc.xml - pdf abc.pdf
-
If command to execute in shell is "FOP.exe -XML abc.xml - pdf abc.pdf" Then file to execute is FOP.exe and arguments are -XML abc.xml - pdf abc.pdf
Hope you get it now ?
-
Hope you get it now ?
No my code still is not working? ProcessStartInfo ps = new ProcessStartInfo(); ps.CreateNoWindow = true; ps.UseShellExecute = false; ps.RedirectStandardError = true; ps.FileName = "cmd.exe"; ps.Arguments = (@"/C" + "\"\"C:\\Program Files\\ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --halfscreen --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); System.Diagnostics.Process proc = Process.Start(ps); Not sure why when its put into a click event nothing happens.
-
No my code still is not working? ProcessStartInfo ps = new ProcessStartInfo(); ps.CreateNoWindow = true; ps.UseShellExecute = false; ps.RedirectStandardError = true; ps.FileName = "cmd.exe"; ps.Arguments = (@"/C" + "\"\"C:\\Program Files\\ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --halfscreen --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); System.Diagnostics.Process proc = Process.Start(ps); Not sure why when its put into a click event nothing happens.
-
No my code still is not working? ProcessStartInfo ps = new ProcessStartInfo(); ps.CreateNoWindow = true; ps.UseShellExecute = false; ps.RedirectStandardError = true; ps.FileName = "cmd.exe"; ps.Arguments = (@"/C" + "\"\"C:\\Program Files\\ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --halfscreen --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); System.Diagnostics.Process proc = Process.Start(ps); Not sure why when its put into a click event nothing happens.
You need not use cmd.exe as it the command shell which would automatically get invoked. your executable file here is /C" + "\"\"C:\\Program Files\\ThinTV\\PLINK.EXE and your arguments is appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=.0; vlc --halfscreen --key-vol-up 100 rtsp://stfamtv0001/streama\"\"" Please arrange it accordingly. Let me know if you still need some help.
-
You need not use cmd.exe as it the command shell which would automatically get invoked. your executable file here is /C" + "\"\"C:\\Program Files\\ThinTV\\PLINK.EXE and your arguments is appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=.0; vlc --halfscreen --key-vol-up 100 rtsp://stfamtv0001/streama\"\"" Please arrange it accordingly. Let me know if you still need some help.
Ok I broke the code down and put it into a click event as follows ProcessStartInfo ps = new ProcessStartInfo(); ps.CreateNoWindow = true; ps.UseShellExecute = false; ps.RedirectStandardError = true; ps.FileName = "/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); System.Diagnostics.Process proc = Process.Start(ps); Not sure but now its getting a Win32Excepetion was unhanded error.... on this line System.Diagnostics.Process proc = Process.Start(ps); The command string is perfect.... its really weird.
-
Ok I broke the code down and put it into a click event as follows ProcessStartInfo ps = new ProcessStartInfo(); ps.CreateNoWindow = true; ps.UseShellExecute = false; ps.RedirectStandardError = true; ps.FileName = "/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); System.Diagnostics.Process proc = Process.Start(ps); Not sure but now its getting a Win32Excepetion was unhanded error.... on this line System.Diagnostics.Process proc = Process.Start(ps); The command string is perfect.... its really weird.
"/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; -----here what is "/C" ? To check the validity of the code. USe ps.FileName = "Notepad"; ps.Arguments = "abc.txt" Check whether notepad opens or not and then check your code accordingly.
-
Ok I broke the code down and put it into a click event as follows ProcessStartInfo ps = new ProcessStartInfo(); ps.CreateNoWindow = true; ps.UseShellExecute = false; ps.RedirectStandardError = true; ps.FileName = "/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); System.Diagnostics.Process proc = Process.Start(ps); Not sure but now its getting a Win32Excepetion was unhanded error.... on this line System.Diagnostics.Process proc = Process.Start(ps); The command string is perfect.... its really weird.
Also do the following ps.FileName = "/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); System.Console.WriteLine(ps.FileName + ps.Arguments); and see the string displayed on the console is the right command string for cmd.exe or not?
-
"/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; -----here what is "/C" ? To check the validity of the code. USe ps.FileName = "Notepad"; ps.Arguments = "abc.txt" Check whether notepad opens or not and then check your code accordingly.
-
/C is a command line switch for cmd.exe. I believe the filename string should be "C:\\Program Files\\RBS ThinTV\\PLINK.EXE"
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
I guess you are correct..
-
"/C" + "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\""; -----here what is "/C" ? To check the validity of the code. USe ps.FileName = "Notepad"; ps.Arguments = "abc.txt" Check whether notepad opens or not and then check your code accordingly.
Ok I was able to verify that this test with notepad worked great so I think the error is in my arguments. The original argument that works in a command prompt is this. "/C" + ("\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); So at this point since we are not using a command prompt the "/C" is nulled which leaves us with "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); Breaking this command string down we have ps.FileName = "C:\\Program Files\\RBS ThinTV\\PLINK.EXE"; and ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); The trick now i believe is int he syntax.
-
Ok I was able to verify that this test with notepad worked great so I think the error is in my arguments. The original argument that works in a command prompt is this. "/C" + ("\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); So at this point since we are not using a command prompt the "/C" is nulled which leaves us with "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); Breaking this command string down we have ps.FileName = "C:\\Program Files\\RBS ThinTV\\PLINK.EXE"; and ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); The trick now i believe is int he syntax.
what do u do soloforce?
-
what do u do soloforce?
-
Im a network engineer for a small company, but I enjoy programing keeps my mind sharp. I dont have much expereince in programing but I sure like it. :-D
cool!!..good to know about you :)
-
Ok I was able to verify that this test with notepad worked great so I think the error is in my arguments. The original argument that works in a command prompt is this. "/C" + ("\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); So at this point since we are not using a command prompt the "/C" is nulled which leaves us with "\"\"C:\\Program Files\\RBS ThinTV\\PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --key-vol-up 100 rtsp://stfamtv0001/streama\"\""); Breaking this command string down we have ps.FileName = "C:\\Program Files\\RBS ThinTV\\PLINK.EXE"; and ps.Arguments = (@"appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\"killall -q vlc; export DISPLAY=:0.0; vlc --video-on-top --key-vol-up 100 rtsp://stfamtv0002/streama\"\""); The trick now i believe is int he syntax.