Script stops services freeing up system resources

netbjarne

Aaargh! Angry!!
Joined
Nov 14, 2005
Messages
112
Hi folks

Dunno if something similar has been posted before, but I thought I'd share the small script I sometimes use for especially demanding applications (that is, civ4).

The scripts stops all stopable services, and this usually frees up quite some memory (you might be surpriced how responsive your computer can be). Some of these services handles your network, so this script is soley for single player games.

One service is restarted after all, this is the Windows Audio service. Otherwise you won't able to hear the narrator say "beep beep beep beep" once you discover satelites :D

Here's how to use it:

Copy the following two lines into a text document using notepad:

for /f "tokens=*" %%i in ('net start') do net stop "%%i" /y
net start "windows audio"


Save the file as "stopservices.cmd" or similar. Be aware that you don't end up with a .txt extension, the script must have a .cmd extension to work.

Now run the script, either by clicking its icon or typing its name on the command line, and you will see windows stopping one service after another - this typically takes around a minute or so.

Play and see if running with fever services does you any good :)

Now, to restart all these service again, its easiest to reboot your computer. No permanent configuration changes are made using the script.

Oh, by the way. I assume that you use Windows XP, 2000 or 2003.

Regards!
Bjarne
 
Well. That of course largely depends on what services you have started normally. But freeing up 50-150 mb of memory is not uncommen. On computers with average amounts of memory, say, 512 mb, freeing up 100 mb can make quite a difference..

I'll do a test on my own computer and get back with the results.

Bjarne
 
I've just ran a few tests. After a reboot, i started windows task manager.

Memory in use was 240 mb with my setup.

After stopservices.cmd that was reduced to175 mb.

That is 65 mb of memory released. So, i assume, that with 512-768 mb of system memory, it makes sense to free up every bit of memory possible for civ4 (that likes 600+ mb). On systems 1gb memory or more, the difference may not be noticable.

However, stopping services does not only free up memory. Indexing, defragging, auto-updating and other services may interrupt your gaming experience - after alle, civ likes all the resorces it can get...

Bjarne
 
but could you please tell me how to keep the network-thingies? I'd like to use this while playing multiplayer?

regards
SmiteMeister
 
I would also lounch Task Manager and kill some processes too.
there is one really useless then playing games: explorer.exe
to lounch a game you'll need to go to 'File >> New Task'
and then if you are fast enough, switch off Task Manager too :)
that will save you few MB of RAM too.
 
SmiteMeister said:
but could you please tell me how to keep the network-thingies? I'd like to use this while playing multiplayer?

regards
SmiteMeister


Credit goes to netbjarne for presenting the script. I just added a few lines of modification.

Code:
for /f "tokens=*" %%i in ('net start') do net stop "%%i" /y
net start "windows audio"
net start "Application Layer Gateway Service"
net start "DHCP Client"
net start "DNS Client"
net start "Server"
net start "Network Connections"
net start "Network Location awareness (NLA)"
net start "WebClient"
net start "Remote Procedure Call (RPC) Locator"
net start "Net Logon"

Just follow the instructions in the first post. Dunno if it actually works to allow Civ4 to play multiplayer games, since my PC has problems with the game, but it *should* work.

_________________________________________________________

As far as performance goes: Civ4 does run faster at startup, but oddly my system takes 50mb *more* RAM than it did before the script was run. My computer is, however, very messed up.
 
Ok this worked great on Age of Empires 3, but the big problem I have is that whenever I play any game I get no sound at all after stopping the systems, I do get sounds in windows, just not in Civ 4 nor Age 3.
 
Felz said:
Ok this worked great on Age of Empires 3, but the big problem I have is that whenever I play any game I get no sound at all after stopping the systems, I do get sounds in windows, just not in Civ 4 nor Age 3.

What ver of Win are you using?
Do you use a PCI sound card, or just one through your motherboard?

It's hard to know how the script is affecting your system without knowing what services are running before and after.
 
:goodjob:
great! best performance increase after patch 1.52, finally I can play endgames fluently on huge earth maps with only 512RAM! Thanks a lot!
 
Hardner said:
:goodjob:
great! best performance increase after patch 1.52, finally I can play endgames fluently on huge earth maps with only 512RAM! Thanks a lot!

Thanks Hardner. I'm glad you like the script. You might also want to check the new "memsaver" .ini file setting of patch 1.52 - as far as I remember, its able to free up quite a bit of precious memory at the cost of alt-tab switching ability.
 
netbjarne said:
Thanks Hardner. I'm glad you like the script. You might also want to check the new "memsaver" .ini file setting of patch 1.52 - as far as I remember, its able to free up quite a bit of precious memory at the cost of alt-tab switching ability.

I tried that, too. But I even saw a performance decrease when switched off. Dunno why. Now it's switched on and also endgames on huge maps are fairly playable. Specs: 1.6GhzCentrinoCPU, 512RAM, ATI9700Mob64RAM.
 
How can I make a script to stop certain processes that I see in the Task Manager? For example, I want to stop hp*.*, saismart.exe, etc.
 
I've been using your script successfully for several months- but it stopped workingthis week.

I suspect this is realted to Windows security updates- any idea how to enable your script to override Windows?

Thanks!
 
eoo2 said:
I've been using your script successfully for several months- but it stopped workingthis week.

I suspect this is realted to Windows security updates- any idea how to enable your script to override Windows?

Thanks!

That sounds odd. I don't think this is security update related - starting and stopping services from the commandline, is a trivial and commonly used method for system administrators - disabling that feature as a security measurement is very unlikely.

Do you have administrator rights? - I suppose you'll need that to disable services.

Try posting the results of the script and I can probably tell you more. You can either open a command prompt and run the script by hand, or, append a "pause" comand to the script, to make it pause when completed. That allows you to copy-paste the output of the script, or you may take a screenshot.
 
jray said:
How can I make a script to stop certain processes that I see in the Task Manager? For example, I want to stop hp*.*, saismart.exe, etc.

You might want to try pskill from sysinternals (freeware) : http://www.sysinternals.com/Utilities/PsKill.html

That little utility allows you to stop processes by process id or process name - you can pskill commands to the stop services scripts. But be careful :-)
 
Thanks, Netbjarne...

I'm attaching the screenshot (acquired with the nifty "pause" command)

As I explained before, this just stopped working sometime during the last week, and so I've been trying to think of what I might have installed to conflict, but I have no idea, other than automatic windows updates.

Anyway, here it is- Many thanks for your help.
 

Attachments

  • screenshot.gif
    screenshot.gif
    15.6 KB · Views: 162
Its quite clear what goes wrong. Windows can't find the file net.exe. That can have two causes:

1) your net.exe file has been deleted (should be located en c:\windows\system32)

2) your "path" enviroment variable has been changed and does no longer point to c:\windows\system32

See the attached screenshot for how to diagnose these issue. If #2 is the cause, you can modify the stopservices script to include the full path the the net.exe command - that is - instead for "net start" and "net stop" it must say "c:\windows\system32\net.exe start" and so on..



No matter what, its a suspicous issue youve got. "path" is not normally changed, and "net.exe" does not normally dissapear. I would perform a full virus/spyware scan just to make sure...
 
Brilliant! Guinness!

I reward you with magical invisible candy!

Woah... this is impressive. Talk about computer nuke!
 
Back
Top Bottom