corbin Posted October 19, 2008 Share Posted October 19, 2008 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.) Quote Link to comment https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/ Share on other sites More sharing options...
DarkWater Posted October 19, 2008 Share Posted October 19, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/#findComment-669469 Share on other sites More sharing options...
Maq Posted October 19, 2008 Share Posted October 19, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/#findComment-669521 Share on other sites More sharing options...
corbin Posted October 19, 2008 Author Share Posted October 19, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/#findComment-669527 Share on other sites More sharing options...
Stooney Posted October 20, 2008 Share Posted October 20, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/#findComment-669658 Share on other sites More sharing options...
corbin Posted October 20, 2008 Author Share Posted October 20, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/129133-hide-a-program-while-running/#findComment-669667 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.