The latest windows script host and VBScript, Jscript engines all come
in one package available at microsoft.com (just do a search on
"scripting"). Latest version being 5.6. There's two seperate downloads
one for Win9x/NT 4.0 and the other for Win2k. WinXP already comes with
5.6.
Win95 and WinNT 4.0 did not come with WSH
Win98, ME (?), and Win2k came with it, but are outdated versions.
Running scripts:
Usage: CScript/Wscript scriptname.extension [option...] [arguments...]
Cscript is commandline version, Wscript is GUI version
::vbscripts::
dsaddplus.vbs
Batch
creates AD accounts from a csv file. First & Last Name, Password,
Department, User Principal Name. Need to add DisplayName. Change the
DOMAINNAME entries.
'Version 0.1
'Tested in Win2k8 environment
Dim Shell
Set Shell = CreateObject("Wscript.Shell")
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
("realusersw.csv", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arrRecord = Split(strNextLine , ",")
MyCmd = "dsadd user cn="& arrRecord(0) & ",ou=batch,dc=DOMAINNAME,dc=edu" _
&
" -fn " & arrRecord(1) & " -ln " &
arrRecord(2) & " -pwd " & arrRecord(3) &
" -dept " _
& """" &
arrRecord(4) & """" & " -upn " &
arrRecord(0) & "@DOMAINNAME.edu -disabled no"
'Wscript.Echo MyCmd
Shell.Run MyCmd
Loop
' -mustchpwd yes
'-display displayname
logon.vbs
AD
logon script that maps one network drive globally for everyone. The
other drive maps if the user is a member of specified group.
'Tested extensively in Win2k8 environment
Const GWARCHIVES = "cn=gw-archives"
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "s:", "\\admin-shared1\shared"
If InStr(strGroups, GWARCHIVES) = 1 Then
wshNetwork.MapNetworkDrive "r:", "\\admin-hd1\archives\" & wshNetwork.UserName
End If
ntfs_homedir.vbs
Mass applies desired NTFS permissions to folders with the icacls
utility. Can be used to assign user's permissions to their home
directories, or to apply access to several directories to one user.
Copy the script to the directory containing the subdirectories you wish
to apply permissions too. This example applies the simple permission of
Modify.
'List subfolders portion is from www.activexperts.com
'Tested on Win2k8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("r:\archives")
Set colSubfolders = objFolder.Subfolders
Set Shell = CreateObject("Wscript.Shell")
For Each objSubfolder in colSubfolders
Shell.Run "icacls " & objSubfolder.Name
& " /grant " & objSubfolder.Name & ":(oi)(ci)m"
'Shell.Run "icacls " & objSubfolder.Name & " /grant bouseer:(oi)(ci)m"
Next
lowercase.vbs
Place this in a folder where you want all files to be renamed to
lowercase and run it. I made this to get rid of old DOS 8.3 eyesores
like README.TXT.
runrdp.vbs
Quick script to inform user to run their VPN client before running
their Terminal Services/Remote Desktop client.
sysprep.vbs
Copies sysprep folder from WINNT to the root of C: and then runs
sysprep.
diskcheck.vbs
Schedules a chkdsk and then restarts computer. Relies on presence of shutdown.exe
defrag.vbs
Runs defrag.
zenfd_install.vbs
Installs the Zenworks for Desktops agent.
cars_install.vbs
Installs CARS.
ystudios_append.vbs
Appends a phrase to all mp3 files within a folder.
ystudios_counter_rename.vbs
Simply names all mp3s in a folder with a name and ascending numerical
value..i.e mymusic1.mp3, mymusic2.mp3, etc. Warning: Original
filenames will be lost.
compinfo.html
Some basic computer information along with a listing of drives, size, and free space. Must be ran in IE.