#196341 - 2009-10-13 08:13 PM
start shell (exe with options)
|
Pireli
Fresh Scripter
Registered: 2009-10-13
Posts: 5
Loc: DE
|
Hello all,
can somebody tell me:
How can I start shell run exe with options like:
SHELL %systemdrive%\XXX\exprogs\runasspc.exe /cryptfile:%systemdrive%\XXX\crypts\localadmin.spc /quiet
I dosn't work, but what is the right command? I looked into shell help but i don't know 
Thanks for help Pireli
|
|
Top
|
|
|
|
#196342 - 2009-10-13 09:02 PM
Re: start shell (exe with options)
[Re: Pireli]
|
eriqjaffe
Hey THIS is FUN
Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
|
You need to put the command you want to run in quotation marks:
SHELL "%systemdrive%\XXX\exprogs\runasspc.exe /cryptfile:%systemdrive%\XXX\crypts\localadmin.spc /quiet"
|
|
Top
|
|
|
|
#196344 - 2009-10-13 09:55 PM
Re: start shell (exe with options)
[Re: Glenn Barnas]
|
Pireli
Fresh Scripter
Registered: 2009-10-13
Posts: 5
Loc: DE
|
Hello,
many thanks Glenn it works! It tested so many and it was just simple ''
The quotation marks do not work I tested....
Thanks!
|
|
Top
|
|
|
|
#196345 - 2009-10-13 11:39 PM
Re: start shell (exe with options)
[Re: Pireli]
|
Pireli
Fresh Scripter
Registered: 2009-10-13
Posts: 5
Loc: DE
|
An issue comes rarely alone 
Now it works but the content from exe file screen into kix script. It looks not really pretty! hm

Any idee to fix it?
Thanks Pireli
|
|
Top
|
|
|
|
#196347 - 2009-10-14 07:47 AM
Re: start shell (exe with options)
[Re: Pireli]
|
Pireli
Fresh Scripter
Registered: 2009-10-13
Posts: 5
Loc: DE
|
Idee's to me
|
|
Top
|
|
|
|
#196350 - 2009-10-14 09:39 PM
Re: start shell (exe with options)
[Re: Glenn Barnas]
|
Pireli
Fresh Scripter
Registered: 2009-10-13
Posts: 5
Loc: DE
|
Hi Glenn,
it works again! You are my personal hero 
I use %COMSPEC% /c but i forgett again the " ' " at start and end 
Can you say me what 2>&1>NULL: means?
Thanks & Nice day Pireli
|
|
Top
|
|
|
|
#196352 - 2009-10-15 12:16 AM
Re: start shell (exe with options)
[Re: Pireli]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
basically says "throw any and all output away".
Every program has two output streams, called Standard Output (STDOUT) and Standard Error (STDERR). These are usually internal file handles 1 and 2, so when a program wants to write an error message, it writes it to file handle 2. Normal messages are written to file handle 1. This is not done in scripting, but in higher (compiled) languages like 'c'.
So - when you run a command, you can redirect the output using ">" into a file or device.DIR > C:\Temp\FileList.txt for example.. You can direct the error messages using "2>errors.txt".
In my example, "NUL:" (note - ONE "L"!) is a device that is kind of a black hole, or bottomless pit. Stuff goes in, but nothing comes out. It's useful to throw away unwanted or unneeded messages. The form "2>&1>" says "send the error messages (STDERR) to standard output, which is then redirected to (in this case) NUL: - causing all output to be discarded.
Note that the 3-character device names are "reserved" words, and include LPT: for the default printer, CON: for the console screen, and NUL: for the bit bucket. COM#: represent serial ports and LPT#: represent parallel ports. If you used "NULL:", it would not be recognized as a device and would create a file called "NULL", or would throw an error.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 271 anonymous users online.
|
|
|