VBS Script to get the location of the current script Files attached

Here is just a quick example of how to get the location of the currently running script.

 

 

currentScriptPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "")

strLogFile = currentScriptPath & "log.txt"

wscript.echo strLogFile

VBS Script to perform an action after a computer either starts or stops pinging Files attached

The below script can be used to monitor when a computer either starts or stops pinging and then run an action.

 

Usage:

Call the function WaitForPing(SuccessOrFailure, "Name or IP", TIMEOUT_PING_SUCCESS)

Set SuccessOrFailure to TRUE to wait for the computer to start pinging

Set SuccessOrFailure to FALSE to wait for the computer to stop pinging

VBS Script to export the file properties of all files in a folder and its sub folders Files attached

The below scripts allows you to select a folder and generate a CSV report detailing the below file properties of all of the file in that folder and the folders sub folders.

 

  • Path
  • Name
  • Size
  • File Type
  • Date Created
  • Date Last Access
  • Date Last Modified

How to use:

1) Download the attached script or copy and save the below as something like report_file_properties.vbs

2) Run the script

VBS Script to delete all file over a certain age in a folder and its sub folders Files attached

The below script will delete all file in a folder over a certain ago and repeat the task for the folders sub folders

Change the varibles startFolder and OlderThanDate as needed.

VBS Script to Install a Font Files attached

The below script will install a Font, you will need to change the string "path_to_font\font_file_name.ttf" to the location and file name of the font

  

VBS Script to disable Adobe Shockwave Auto Apdate Files attached

The below script will disable the auto update feature of Adobe Shockwave, I have tested this script on version 11.5 but it should also work on other versions.

VBS Script to disable Sun Java Auto Apdate Files attached

The below script will disable the auto update feature of Sun Java, I have tested is on JRE 6 update 16 but it should also work with other versions.

VBS Script to disable Adobe Reader 9.x Auto Apdate Files attached

The below script will disable the auto update feature of  Adobe Reader 9.x  and also stop the Adobe Reader Speed Launcher from launching at startup

Using a VBS Script to Create a Shortcut and a Shorcut to a URL Files attached

The below will show you how to use a VBS script to create a standard Windows shortcut and also a URL shortcut to a webpage.

Creating a Standard Windows Shorcut

In the below example script I am simply creating a shortcut to Notepad using the properties .TargetPath and . Description however there are a few other propertiesyou can make use of.

Change the Windows Password Expiry Notification Period from 14 Days Files attached

If you are looking to change the windows default password expiry notification from 14 days to somthing else then this should help.

The default value of 14 days is stored in the DWORD registry key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\passwordexpirywarning simply changing or creating this key will alter the number of days prior to expiry the user will get notified.

If like me you want to change this for more than one computer then the below vbs script run as part of a logon script etc should do the trick.

Design by
ThemeShark.com - Drupal Themes with Bite!
Drupal Themes
with bite!