JSI Tip 7175. The Scripting Toolkit freeware.

Jerold Schulman

September 11, 2003

11 Min Read
ITPro Today logo in a gray background | ITPro Today

The makers of ScriptLogic and Desktop Authority have provided the Scripting Toolkit freeware to enhance your batch scripts.

NOTE: In the Windows & .NET magazine's 2003 readers' choice awards, ScriptLogic won Best Software, 2 bests in the System Management catagory, and a best in the Utilities catagory.

The Scripting_Toolkit.htm file contains:

Copyright (C)2003 ScriptLogic Corporation

TheScripting Toolkitis a collection of several Win32 utilities that we've created to make scriptinga bit easier. While our flagship product, ScriptLogic, offers the functionality of these toolsnatively, we realize that ScriptLogic is not right for every situation.

Whetheryou're writing your own logon scripts, or you're simply creating automationscripts for use outside the logon process, we hope you find the utilitiescontained in the ScriptingToolkitextremely helpful.

Thereare currently nine utilities contained in the toolkit:

CancelBt

Enable or disable the Cancel button on any dialog at will.

ClrName

Erases the last user's name from the Windows 95 logon dialog box.

HideExec

Conceals the screen output of any application (Windows or console-based).

MakeScut

Creates Windows Shortcuts (.lnk/.pif/.url).

MMD

Creates a multi-level [sub]directory structure.

NetOrder

NetOrder allows you to switch the network provider call order in Windows 9x. A necessity if you have a mixed Microsoft/Novell environment and are using Novell's Client32.

PlayWav

Plays any WAV file (asynchronously).

StartBt

Temporarily hides, shows or permanently removes (for the current session) the the Start button from the Taskbar.

xDel

Tool to delete all files in a folder (and optionally recurse subfolders like the old DOS utility, DelTree).

If you like these little utilities, you'll love ScriptLogic! Be sure to stop by and read about all the amazing features found in our flagship product at http://www.scriptlogic.com.

 

CancelBt is used to enable or disable the Cancel button on the active Window.

Purpose

This can be extremely useful when performing automated software deployments. Many software packages, even when instructed to use the /Quiet mode, after display a progress dialog with a Cancel button. Unfortunately, users have been know to repeatedly press this button for no apparent reason.

By disabling the cancel button while the automated software deployment is taking place, the user is unable to abort the process.

Syntax

CancelBt [/enable] [/disable]

/enable

Loaded the CancelBt application into memory. While in memory, the cancel button of the top-most window will be hidden.

/disable

Unload the CancelBt application from memory.

Note: This component is still under development.

 

Use this 32-bit utility to clear the last user's name from the Windows 95 logon dialog box. 

Purpose

  1. To increase network security: The default of displaying the user's name that last logged on leaves the potential hacker with only having to guess the last user's password, rather than both their name and password.

  2. To reduce network administration: As a network administrator, how many times have you taken a call from a user like this? "I can't logon today. The system keeps telling me my password is invalid." Then, after checking the network account's lockout status, you realize that while the user is typing the correct password, someone else's name is in the username box. Perhaps this was another user or maybe it was you doing some late night work on their PC. Need I say more?

Of course, with all platforms after Windows 95 (including 98, Me, NT4, 2000 and XP), automatically clearing the last username from the logon dialog box is a simple registry change, and is often performed through policies. Unfortunately, this functionality was never included with the Microsoft Windows 95 operating system.

Simply copy the executable, or place a shortcut to the executable, in your Windows startup folder. Alternatively, you could utilize the HKCUSoftwareMicrosoftWindowsCurrentVersionRun or RunOnce registry keys or include ClrName.exe as the last line in your login/logon script.

If you use ClrName with Windows NT 4.0, Windows 2000 or Windows XP, the user logging on must be an administrator of the local machine (or otherwise have access to write the necessary values to the registry).

Syntax

ClrName xx

xx is an optional command line parameter used to indicate the number of seconds to wait before clearing the last username. The default delay if 15 seconds if no specific delay is specified on the command line. The delay is used so that if you call ClrName from your login/Logon script, the script has enough time to finish execution before the Window 9x logon completes and the shell (Explorer) is loaded. 

Example:

ClrName 60

wait 60 seconds before clearing the last username.

 

 

HideExec is a 32-bit command-line utility used to conceal the screen output of any program. 

Purpose

This can be especially useful in scripting languages and/or logon scripts, when console-based applications are needed, but where their screen output isn't desired.

Syntax

HideExec program

Simply prepend your normal command line with the HideExec utility.

Example:

If you would normally execute the following command line during your network logon process:

NET TIME \SERVER /SET /YES

You could conceal the screen output and the console window that might be create by using HideExec as follows: 

HIDEEXEC NET TIME \SERVER /SET /YES

Note: If the application executed by HideExec does not terminate on its own, it will remain in memory until the user that executed it logs off. Always test your applications thoroughly before wrapping them inHideExec.

Example code that can be used in a KiXtart script:

Use this 32-bit command-line utility used to dynamically create shortcuts on the Windows 95/98/Me/NT/2000/XP operating system.

Purpose

MakeScut can create shortcuts in any folder on the client, including the Desktop, Start Menu, Program Menu, IE Quick Launch Bar, etc. The MakeScut utility is used by ScriptLogic to create the Shortcuts defined on the Shortcuts tab in the ScriptLogic Manager. You can also get creative by using the MakeScut utility within ScriptLogic custom scripting.

Syntax

MakeScut /n "xxx" /t "xxx" [/i "xxx"] [/a "xxx"] [/s] [/r] [/o] [/k] [/c "xxx"]  

/n

Name of the shortcut to be created, including the full path.

/t

Target application that the shortcut will be used to launch, including full path.

/i

Filespec (and optionally an index) of the icon for the shortcut, including full path.

/a

Arguments used by the target application.

/s

Start in (a.k.a. Working directory), including full path.

/r

Run window. Default is a normal window. Options include min or max.

/o

Overwrite. If the /o switch is not specified, the default behavior is do not overwrite.

/k

Shortcut Key used to launch the application. 

/c

Comment (displayed on mouse hover). 

Notes:  

  • The name (/n) and target (/t) parameters are required. All other parameters are optional. 

  • Surround the /n, /t, /i, /a and /c parameters with "double quotes" if the parameters contain spaces, slashes, etc.

  • MakeScut will default to the current folder if no full path is specified for any parameters including /n, /t, /i and /s.

  • MakeScut will automatically create the appropriate type of shortcut (.lnk, .pif or .url) based on the type of target application.

Example code that canbe used in a KiXtart script:

 

MMD is used to create directories (folders). MMDallows folders to be created more than 1 level deep.

Purpose

This function is useful within your scripts to create folders/subfolders.

Syntax

MMD [drive:]path

drive:

Specify the driveletter on which the folder(s) will be created.

path

Enter thepath of the folder(s) to be created.

Examples:

MMD H:Documents

will create a Documents folder on drive H:

MMD H:DataExcel

will create a Data folder, if it does not exist as well as an Excel subfolder.

 

 

NetOrder is used to change the network client call order used when logging on to the network.

Purpose

Use to change the network call order as well as query the state of the current call order from the registry. It is designed so that you could change the network call order of your 9x clients, centrally - VIA your existing NetWare logon script. Useful if you're migrating to NT/2000 with the help of ScriptLogic, doing it yourself with KiXtart and/or batch files, or even if you're just running a heterogeneous (NT/NW) network. 

Syntax

NetOrder [/query] [/ /]

/query

Use to query the network call order of either Microsoft or Novell. Specify /M for Microsoft or /N for Novell.

/First Provider

Specify /M (Microsoft) or /N (Novell) to make it the first provider in the network call order. 

/Second Provider

Specify /M (Microsoft) or /N (Novell) to make it the second provider in the network call order.

Examples:

NetOrder /query    

Queries the registry for the current network call order.

NetOrder /M /N

Makes the current network call order first Microsoftand then Novell.

 

Playwave is used to execute a .wav sound file.

Purpose

Use to play a wav file from within a .BAT file or logon script. 

Syntax

Playwav wavfile[.wav]

wavefile

Specify the .wav filename. Optionally specify the .wav filename extension.

    

Example:

Playwav ding.wav

Plays the specified .wav file.

 

StartBt is used to hide, show or disable the Taskbar's Start button.

Purpose

Prohibiting the user from gaining access to the Start Menu is one of the few lock-down steps that cannot be performed by policies.

Syntax

StartBt [/hide] [/show] [/remove]

/hide

hides the Start button.

/show

shows (un-hides) the Start button.

/remove

removes the start button for the remainder of the user's session. Once removed, the /show argument has no effect. The only way to get the Start button back after removing it is to restart Explorer.

 

XDel is used to delete the contents of a directory.

Purpose

Use from within a .BAT file or script to delete the contents of a directory. The directory itself may optionally be deleted.

Syntax

xDel /d source [/deltree] [delbase]

source

Directory to delete from.

/deltree

Recurse subdirectories.

/delbase

Delete the source directory.

    Examples:

xDel /d %TEMP%/deltree

Deletes all files from the %TEMP% directory including all subdirectories

xDel /d X:JunkFiles/deltree /delbase

Deletes all files from X:JunkFiles including all subdirectories. The JunkFiles directory is also deleted.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like