Hey guys,
So I'm one of those admins that likes writing scripts, and there is one tool in system internals that I love the most, if you don't know what system internals is, google it and use it. Needless to say I use one program more than others and that is "PSKILL", this program is amazing.
If you have a pesky program that won't close, pskill it and poof. I made a script since I use the program so much and because I'm lazy, I have about 30 custom scripts; lol at my last job my co-workers would call me a clicky admin since all I did was click on scripts to fix program (Hey I got tired of running the same command over and over again)A simple script goes like this:
NOTE: you will need pskill.exe from System Internal in the system32 folder (where cmd is located) for this script to work. Also I like putting humor in my programs, lol. lastly whatever you name don't forget to save your batch files as "[file name].bat"
============================================
@echo off
color 0A
title close that program.
:start
echo Welcome, %USERNAME%
echo What would you like to do?
echo.
echo 1. Close the program in question
echo.
echo 2. Click here for a Nude photo!
echo.
echo 0. Quit
echo.
set /p choice="Enter your choice: "
if "%choice%"=="1" goto program-kill
if "%choice%"=="2" goto pervert
echo.
if "%choice%"=="0" exit
echo Invalid choice: %choice%
echo.
pause
cls
goto start
:pervert (lol this is a ":[]P" without the [] , forum emotes ftl)
cls
echo your a pervert, you know it, you clicked on this option shame on you!!!
echo.
goto cancel-special
:program-kill
echo.
set /p computer="Enter computer name:"
set /p program="Enter program name (before .exe): "
echo.
echo Input computer and program to close them
echo.
pskill -t \\%computer% %program%.exe
:cancel-special
set /p cancel="Type cancel to stop action: "
if not "%cancel%"=="cancel" exit
cls
echo Action is cancelled.
echo.
pause
exit
==================================
==================================
Another useful script I made not long ago, very handy, took me about 1 hour to write it, but now I'm super lazy and never type it again! lol!!!! ....system admins that deal with print spooler will love this...
@echo offcolor 0Atitle Fix Printer Spooler.:startecho Welcome, %USERNAME%echo.echo What would you like to do?echo.echo 1. Stop Print Spoolerecho.echo. Please select both option 3 and option 4 before starting the printer spoolerecho.echo 2. Delete .shd files in PRINTERS folderecho 3. Delete .spl files in PRINTERS folderecho.echo 4. Start Print Spoolerecho.echo 0. Quitecho.set /p choice="Enter your choice: "if "%choice%"=="1" net stop spoolerif "%choice%"=="2" del %systemroot%\System32\spool\printers\*.shd /qif "%choice%"=="3" del %systemroot%\System32\spool\printers\*.spl /qif "%choice%"=="4" net start spoolerif "%choice%"=="0" exitecho Invalid choice: %choice%echo.pauseclsgoto start
exit