Question Locked

Where to learn scripting

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Im just trying to find an easy way to script so I can make my life a little easier at work. Just a few things I need to do and they are simple, accessing a file barried deep on the servers, making files to clean out temp directories. Im a field tech and anything that can make my life a little easier and less time spent in the field. if anyone can help it would be greatly appreciated.

5 replies

by ---tk---

are easier... just a set of cmd commands... here is a small one that is fun.... for XP

@echo off

Rem ********* Delete Temporary Internet Files: ****
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

Rem ********* Delete Cookies: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

Rem ********* Delete History: *********************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

Rem ********* Delete Form Data: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

Rem ********* Delete Passwords: *******************
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Rem ********* Remove All IE Cached Data ***********
Rem RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

Echo ********* Removing All Temp Files and Cookies for IE *************
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Echo.
Echo Removal of All Temp Files and Cookies for IE has Completed!

Echo.
Echo.
Echo.

Echo ********* Removing PC Temporary Files **********
rmdir /S /Q "%userprofile%\Local Settings\Temp" 2>Nul
mkdir "%userprofile%\Local Settings\Temp" 2>Nul

rmdir /S /Q %windir%\Temp 2>Nul
mkdir %windir%\Temp 2>Nul

c:\windows\system32\cleanmgr.exe /dc /sagerun: 1

Echo.
Echo Removal of PC Temporary Files has Completed!

Echo.
Echo.
Echo.

Echo ********* Defragging Hard Drive **************
defrag C: -f -v

GOTO End

:End

Echo.
Echo.
Echo.

Echo y > chkdsk.txt
chkdsk C: /F /R < chkdsk.txt
shutdown -r -t 10

Pause
exit

by Member 25348569

If it's Windows then go for PowerShell. It's MS's new scripting language for all of their systems from now on.

Just Google and take it on from there.

Neil :)

The nice thing about PowerShell is that you can do everything from the shell's command line one line of your script at a time or you can write a complete script and run that.

This discussion is closed to new replies.