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
https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/
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

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

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. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.