PDA

View Full Version : Batch files create unsightly desktop clutter...pffft



dchip
01-03-2004, 03:24 PM
My clan and I have set up a remote server to host a couple of the games we play( 3 Mohaa servers and also 1 COD server). Here is an example of one of the batch files:

@echo off
cd\
cd\ c:\Program Files\Games\MOHAA\
mohaa_server.exe +dedicated 1 +dedicated 2 +set net_port 12206 +exec thepit.cgf


We created shortcuts to the batch files and set them to run "minimized", then placed the shortcuts in the startup folder to activate them at boot time.

That works fine except for one thing...

The server windows remain open and on screen for the whole day and their supporting "Dos" windows(the batch files) remain open too but are minimized.

Is their a way to have the servers running whilst having their supporting windows and the "Dos" windows closed?????(in other words, no windows remain open but the servers are still running).

Silly I know because the server dosen't even have a screen...never the less I was asked if I could do it that way... only god knows why, and he won't speek to me after the last stupid question I put too him...lol

PoWa
01-03-2004, 04:08 PM
You put the cls command on the last line:

@echo off
cd\
cd\ c:\Program Files\Games\MOHAA\
mohaa_server.exe +dedicated 1 +dedicated 2 +set net_port 12206 +exec thepit.cgf
cls

That would close the dos window. (XP/2000)

Then you could maybe try having the batch file disable the explorer.exe service to give maximum computer performance.

Graham L
01-03-2004, 04:14 PM
1. cls clears the screen. It doesn't close any running sessions.

2. The server is a headless one, so clearing the screen does nothing. ;-)

3. If the programme is run from DOS, it has to have a DOS session to run from. Ever tried sawing off the branch that you're sitting on?

4. If it works, don't fix it.

5. :D

dchip
01-03-2004, 04:46 PM
roflmao@"Ever tried sawing off the branch that you're sitting on?"....I like that one and yes you are absolutely right when you say:"If it works, don't fix it."

Now my only problem is how to convince the other members (well, one in particular) that we don't really have a problem....lol

Anyways, hope at least ya got a bit of a chukkle out of it...it was intended to be just a "by the by..." sort of thread...not of much concern at all...just had me curious, ya know?

Thanks all for your time and effort..:)

somebody
01-03-2004, 05:04 PM
Are you able to set that command as a shortcut, instead of a batch file, and then put that shortcut somewhere out of the way, and just set it in Scheduled Tasks to run on every bootup?

somebody
01-03-2004, 05:06 PM
eg. create a shortcut to:

"C:\Program Files\Games\MOHAA\mohaa_server.exe +dedicated 1 +dedicated 2 +set net_port 12206 +exec thepit.cgf"

PoWa
01-03-2004, 05:13 PM
> 1. cls clears the screen. It doesn't close any running sessions.

cls closes the command window! No clearing of screen. I'll be money on it. Make a batch file in XP/2000 and it will happen!

> 2. The server is a headless one, so clearing the screen does nothing.

Yes, but he asked :p

dchip
01-03-2004, 06:00 PM
Yes I tried the shortcut and windows task manager....but it didn't work...it started the server but would'nt set the port or start the .cfg file.

btw:I tried the cls command:

notepad.exe
cls


....the window stays open until I close notepad.

btw can we post screenies in this formum?

Fire-and-Ice
01-03-2004, 06:48 PM
> btw can we post screenies in this formum?

Sort of ;-)

Post your screenie here (http://sal.neoburn.net/imagef1/?mode=home) then post the link in your thread.

dchip
01-03-2004, 07:06 PM
Coool...thanks for that :)

Here's the screenie then:
http://sal.neoburn.net/imagef1/files/testbat.jpg

btw....in regards to the typo that appeared at the bottom of my last post (formum)....hehehe...as it happens I was talking to me mum on the phone while posting....how bizare...lol:p

somebody
01-03-2004, 10:18 PM
what if you put the entire command in " " marks??

There was a post a while back on how to close command prompt windows in a batch file.... http://pressf1.pcworld.co.nz/thread.jsp?forum=1&thread=34171&message=155182&q=closing+bat#155182
which suggests right-clicking on the batch file, and setting it to "close" when finished.

Graham L
02-03-2004, 01:33 PM
But the DOS session isn't finished until any tasks in it are finished. Starting the batch script starts a session. Any processes started by the batch are sub-processes of the first session, which "owns" the resources used by the sub-process. Kill the session, kill the sub-process. Messily.

Even if you have never used real operating systems, haven't you tried to click on the "X "of a DOS window which has a programme started from it?

I will say it again, cls is a DOS command which clears the screen. When the DOS screen is a window under MS Windows, and a cls is the only command in a batch file, it will clear the screen, then the batch file ends. Running the cls doesn't terminate the session. The end of the batch file might.

dchip
03-03-2004, 02:46 PM
No need to post any more on this one, Graham L has sumed it up quite nicely.

Thanks everone for your input. :)

PoWa
03-03-2004, 04:05 PM
> I will say it again, cls is a DOS command which clears the screen. When the DOS screen is a window under MS Windows, and a cls is the only command in a batch file, it will clear the screen, then the batch file ends. Running the cls doesn't terminate the session. The end of the batch file might.

I've used batch files before and the cls command closed the batch window down.