views:

1386

answers:

2

I have script lets say:

C:\foo.bsh

I want to be able to run this command via the windows run command:

Start -> Run

Windows Key + R

and type something small like 'foo' and hitting return.

However, I do not want a cmd prompt to be visible. This script does some preprocessing for an IDE. I do not want the cmd prompt to be open for the lifetime of the IDE process.

I have tried: 1) Creating a bat file with the following contents: c:\cygwin\bin\bash --login "C:\foo.bsh" (this fails because it keeps a cmd open)

2) Converting the above bat file to an exe using bat_2_exe_converter (does not make the cmd silent)

thoughts?

EDIT: The solution so far suggests something to type from an actual cygwin shell. I am trying to get a faster solution by having something short I can type in the windows run command. Also, the nohup command; exit doesn't automatically kill the box - however I can manually kill it without killing the IDE process. The run command accepts shortcuts (.lnk's), bat's, exe's.

+2  A: 

As the terminal can't close while your script is still running, try the command:

"nohup C:\foo.bsh; exit"

This way your script will be backgrounded and detached from the terminal, and it should exit quickly so the terminal goes away. I think that the window may still 'flash' with this approach, but the results should be better than what you're getting.

Dana the Sane
A: 

Another imperfect possibility is to run the script via a shortcut and set the shortcut's Run option to "minimized".

anon