Jump to content

Hide a Program While Running


corbin

Recommended Posts

Hi, this is probably in the wrong section.  I thought about posting it in "Other Programming Languages", but it has nothing to do with programming.

 

 

Anyway, hopefully someone can help me with this.  I compiled Psybnc under Cygwin, so I can run it almost natively under Windows (with dlls from Cygwin).  Anyway, my question is how to run a program in the background, so I don't have an ugly command prompt window floating around.  I've tried googling for the past hour, and I've found random things like scheduled tasks or so on, but everything either doesn't do exactly what I want it to do, or it is outdated.  If I could make it a service that would be awesome, but sc.exe out of the 03 resource kit didn't work right, and I think things have to be coded a certain way to work as a service.

 

 

The closest I've gotten so far is start /B, which hides the command, but unfortunately, the process spawned is a child of the cmd prompt that start /B is run from, so when cmd is closed, it kills psybnc.

 

 

Someone please help :(.

 

 

 

 

(P.S.  Sorry if this is in the wrong section.  I feel like a noob saying that.)

Link to comment
Share on other sites

I don't use Cygwin (nor have I), but I know what it is, and I'd assume it supports the 'background' operator.  Try adding & after the program name (and any args).

 

psybnc &

 

Not sure if it will work on Cygwin or anything, but you never know. =P

 

Yes it does work...  Actually using it right now for xemacs  ;D

Link to comment
Share on other sites

Same problem.  Works fine.  It runs in the background, but it terminates when bash terminates.  (Or cmd)

 

 

Edit:  Oh, the only solution I've actually found that does what I want so far is a tiny VB app.  I don't want to use it though.

Link to comment
Share on other sites

You can do something like this with autoit, here's a bit of code someone gave me at one point:

 

Local $i_timedelay = 60000
Local $s_app_name_location = "c:\xampp\php\php.exe"
Local $s_command_line = "c:\path\to\script.php"
While 1
    Run('"' & $s_app_name_location & '" "' & $s_command_line & '"', "", @SW_HIDE)
    Sleep($i_timedelay)
WEnd

 

the @SW_HIDE just makes it so there's no window popping up. 

Link to comment
Share on other sites

That would work, and thanks, but I was hoping for something more....  Native-ish.  It seems silly to me to have to use something like that to run an application and suppress output.  I guess I'll just stick with the little VB script I came across.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.