Archive for the ‘Scripting’ Category
Here’s a quick script to add a user to the local computer in the administrators group and hide the user account from the logon screen. This is intended for Windows XP. Wrote this after brief research (noted in script) because I needed to add user accounts across multiple computers easily. Of course, the password [...]
This is turning into a nightmare. I have 2 Windows 2003 servers. One is the primary DNS server. The second server is a DNS secondary. The DNS was configured improperly when this was setup initially. Instead of wanting to manually alter 435 DNS entries, I have decided to try to script this (efficiency is intelligent [...]
A quick script to shrink TIF file sizes by just converting from TIF to TIF using IrfanView in a batch script. Very simple procedure.
@echo off
: SCOPE: resize all tif files as originals are large and allscripts does not support compression
: natively in their scan/queue software :(
:
: AUTHOR: Richard Kreider
: [...]
Automate FTP Transfers
Few things you need to know:
1) This isn’t fail safe. In other words, if the transfer fails, it fails. There’s no retries,
or error checking.
2) This heavily relies on FTP script files, which I will show you how to create in this file.
3) You can schedule this to run on a daily/weekly/monthly basis via [...]
I often need to remotely backup my SQL backups, but being that they are a few gigabytes I needed a way to automate compressing the backups and since SQL 2005 doesn’t provide this (2008 does) I spent a few minutes and wrote the following script:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set ZIPPATH=C:\program files\7-Zip
: Set BACKUPROOT
set BACKUPROOT=”D:\Program Files (x86)\Microsoft SQL [...]
This is for Windows 2000/XP, Server 2000/2003
cd /d c:\Documents and Settings
for /d %%X in (*) do rd /s /q “C:\Documents and Settings\%%X\Local Settings\Temporary Internet Files”
for /d %%X in (*) do rd /s /q “C:\documents and settings\%%X\Local Settings\Temp”
Quick and dirty.
Download the batch from here (run-as).
Here’s a quick command line method for grabbing CPU usage of a process by process id, process name, or caption.
By Process ID
wmic path win32_perfformatteddata_perfproc_process where (IDProcess = ‘3488′) get Name, Caption, PercentProcessorTime, IDProcess /format:list
By Process Name
wmic path win32_perfformatteddata_perfproc_process where (Name=’iexplore’) get Name, Caption, PercentProcessorTime, IDProcess /format:list
By Process Name (fuzzy)
wmic path win32_perfformatteddata_perfproc_process where (Name like [...]

