Restart Backup Exec Services Script
cd C:\Program Files\VERITAS\Backup Exec\NT\ bemcmd -o503 timeout 60 bemcmd -o502 exit
read moreMS DOS script to rename, append date, delete files older than 30 or N days
If you use Windows Server 2003 built-in NTBackup, you may need to move daily backup files into an archive folder, and delete old files. Here is a script to rename and append time/date to backup file, move it to an archive directory, and search and delete all files older than 30 days. ren E:\ntbackup\backup2.bkf backup1_%date:~4,2%%date:~7,2%%date:~10,4%_.bkf move E:\ntbackup\backup?_* E:\ntbackup\archive forfiles /P “E:\ntbackup\archive” /S /M *.bkf /D -30 /C “cmd /c del @PATH” Set this as a scheduled task after your...
read moreScripting – check if process or program is running and start it
Sometimes you have to have a program running for other programs to work. If this program does not run as a Windows service, use this script to check for program’s process name, and start it if it’s not running. Use your own process name instead of ‘calc.exe’ and you can take out the ‘wscript.echo’ line. Then, run this script under Scheduled Tasks every 15 minutes or so. You may have to run the scheduled task with elevated privileges, or using a Local Administrator or Domain Administrator...
read moreMS robocopy backup and syntax usage
Starting in Windows Vista, Microsoft introduced robocopy command to replace xcopy from Windows XP. Robocopy can be downloaded and installed on any Windows XP or even older Windows Server computer. I use this simple robocopy script that runs as a scheduled task every day to backup “My Documents” folder to the file server: @echo off net use K: /delete net use K: \\192.168.1.116\backup @echo on robocopy "C:\Users\user-name-here" "K:" /E /A /V /NDL /NP /LOG:"C:\backupLog.txt" /XF *.mp3 ntuser.* /XD...
read moreScripting – Back up PST file
Option Explicit Const OverwriteExisting = True Dim objWMIService Dim objFileOut Dim objTextFile Dim strDriveName Dim WshNetwork Dim strUserName Dim colDisks Dim objDisk Dim strDate Dim colItems Dim objItems Dim PST_array(500) Dim PST_i_counter Dim k Dim strFolderName Dim arrFolderPath Dim strNewPath Dim i Dim objFSO Dim objFolder Dim FileWritePath Dim DocumentationFile Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2″) PST_i_counter = 0 ‘Gets current username Set WshNetwork =...
read moreScripting – Exchange mailbox size and number of messages
‘This script logs on to a server that is running Exchange Server and ‘displays the current number of bytes that are used in the user’s ‘mailbox and the number of messages. ‘ USAGE: cscript MailboxSize.vbs SERVERNAME MAILBOXNAME ‘ This requires that CDO 1.21 is installed on the computer. ‘ This script is provided AS IS. It is intended as a SAMPLE only. ‘ Microsoft offers no warranty or support for this script. ‘ Use at your own risk. ‘ Get command line arguments. Dim obArgs Dim...
read more
