Jump to content

Some services scripts I use


Recommended Posts

Posted (edited)

Hello

maybe you`ll find this useful:

@cls
@echo [sys variables]
set
echo rem ::Services>cu.txt
(@echo rem net stop " ")>>cu.txt
@sc query|find /i "seRVicE_nAMe">>cu.txt
start cu.txt
pause>nul
exit
rem;)oDgo

Gives variable view & exports services of computer to prepared file to make an cmd file from for shuting down services on computer. Actually this is for local run. I`m using it for review&temporary shutdown services on computer.

To use it with psexec http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx you`ll need to think of where ur saving your file containing services on remote computer. Adding some prepared remote directory looks like easy way to handle with it.

@cls
net use z: \\server\dir /user:temporaryluser passwd
echo rem ::Services>Z:\cu.txt
(@echo rem net stop " ")>>z:\cu.txt
@sc query|find /i "seRVicE_nAMe">>z:\cu.txt
pause>nul
net use z: /d
exit
rem;)oDgo

This is good to b sent by psexec to run. You`ll find services running on remote computer saved in \\server\dir\cu.txt . you can also change cu.txt to %computername% variable if u would like to use it on more computers over net.

Edited by Yzöwl
All double ampersands replaced by line returns

Posted

Now I've finished making your post readable and in a more appropriate topic etc., I'd like to ask if you could break down your series of commands explaining what exactly it is they do!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...