How to hide command window?

  • Thread starter Thread starter Ronny
  • Start date Start date
R

Ronny

I have an application (rxvt) which opens a Window when started (which
is not that unusual after all ;-)

The behaviour of this application can be customized via environment
variables. Now I would like to have on my desktop several icons,
each of which would, when clicked, launch this application, but
with a different set of environment variables.

To do this, I first created a CMD file corresponding to each of
the possible invocation patterns. Each CMD file looks roughly like
this:

rem Customize environment
set FOO=....
set BAR=....
rem Launch application
myappl.exe

Then I create desktop icons and associate them with each of these
CMD files.

This works well, but of course when I click on that icon, I see
a CMD window in addition to the window created by my application.

Is there a way how to hide this command window? Or is there a
better alternative to accomplish my goal?

Ronald
 
Ronny said:
I have an application (rxvt) which opens a Window when started (which
is not that unusual after all ;-)

The behaviour of this application can be customized via environment
variables. Now I would like to have on my desktop several icons,
each of which would, when clicked, launch this application, but
with a different set of environment variables.

To do this, I first created a CMD file corresponding to each of
the possible invocation patterns. Each CMD file looks roughly like
this:

rem Customize environment
set FOO=....
set BAR=....
rem Launch application
myappl.exe

Then I create desktop icons and associate them with each of these
CMD files.

This works well, but of course when I click on that icon, I see
a CMD window in addition to the window created by my application.

Is there a way how to hide this command window? Or is there a
better alternative to accomplish my goal?

http://www.uwe-sieber.de/files/hidrun.zip

If you start
c:\test\test.cmd
change to
c:\test\hidrun c:\test\test.cmd
assuming you put the hidrun.exe to c:\test.


Greetings from Germany

Uwe
 
Try using a .js file to run the CMD file. Something like

var WshShell = new ActiveXObject("WScript.Shell");
WshShell.run("C:\\foldername\\filename.cmd", 0, false);

Just substitute the path and filename you are using and save it as
filename.js. You can then make a shortcut to it for the desktop if desired.
Be sure to use double backslashes in the path as in above example.
(In case of wordwrap, there are 2 lines in the script, each one ends with a
semi-colon.)
For more details see
http://msdn2.microsoft.com/en-us/library/d5fk67ky.aspx
 
Hi Ronald,

Method 1: Using a VBScript to launch a .CMD or .BAT file invisible. Check these links:

http://groups.google.com/group/microsoft.public.windowsxp.general/msg/5e39f8a64270b620
http://groups.google.com/group/microsoft.public.windowsxp.general/msg/d281575031842fed

Method 2:

http://groups.google.com/group/microsoft.public.windowsxp.general/msg/647cc8688adbef90

Method 3:

To run the command script window minimized, see:
http://groups.google.com/group/microsoft.public.windowsxp.general/msg/5a750118becee275

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
Windows® Troubleshooting http://www.winhelponline.com


I have an application (rxvt) which opens a Window when started (which
is not that unusual after all ;-)

The behaviour of this application can be customized via environment
variables. Now I would like to have on my desktop several icons,
each of which would, when clicked, launch this application, but
with a different set of environment variables.

To do this, I first created a CMD file corresponding to each of
the possible invocation patterns. Each CMD file looks roughly like
this:

rem Customize environment
set FOO=....
set BAR=....
rem Launch application
myappl.exe

Then I create desktop icons and associate them with each of these
CMD files.

This works well, but of course when I click on that icon, I see
a CMD window in addition to the window created by my application.

Is there a way how to hide this command window? Or is there a
better alternative to accomplish my goal?

Ronald
 
Try using a .js file to run the CMD file. Something like

var WshShell = new ActiveXObject("WScript.Shell");
WshShell.run("C:\\foldername\\filename.cmd", 0, false);

Thank you - I didn't even know that Windows natively supports Script
files
in JavaScript!

Ronald
 
You're welcome. Be aware that if you use some sort of AV 'Script Blocking'
feature, this may trigger an alert due to the fact that it runs a program
(your CMD file).
 
Back
Top