I am trying to create a VBScript that when it runs would remove the system (Power-on) password on our companies laptops without any interaction from the user.
CCTK (Dell Configuration Tool Kit) has been installed on each of the laptops and I have created the below code so far.
------------------------------------------------------------------------------
DIM WshShell
Set WshShell = CreateObject("Wscript.Shell")
Set WshNetwork = CreateObject("Wscript.Network")
strComputer = WshNetwork.ComputerName
password=strComputer
password=Replace(password,"Value1","Value2")
DIM aParm(2)
sCmd="C:\Program Files\Dell\CCTK\X86\cctk.exe"
aParm(1)="--syspwd= --valsyspws="
aParm(2)=password
wscript.echo sCmd & Join(aParm)
------------------------------------------------------------------------------
I am needing it to run the following command 'C:\Program Files\Dell\CCTK\X86\cctk.exe --syspwd= --valsyspws=<PASSWORD>
The script above, when I output to messagebox has a space before the <PASSWORD> value so the whole aParm section might not be any use.
Can anyone recommend the line, or two, needed to get this VBScript working?
Cheers
I had to copy the 'cctk.exe' file and 'mxml1.dll' to the System32 folder but I managed to get it working with the code below:
------------------------------------------------------------------
DIM WshShell
Set WshShell = CreateObject("Wscript.Shell")
Set WshNetwork = CreateObject("Wscript.Network")
strComputer = WshNetwork.ComputerName
password=strComputer
password=Replace(password,"Value1","Value2")
Set oShell = WScript.CreateObject( "Wscript.Shell" )
sSystemRoot = oshell.expandenvironmentStrings("%SYSTEMROOT%")
SVar = "--syspwd= --valsyspwd="
sPermissionCommand = sSystemRoot & "\System32\cctk.exe " & svar & password
wscript.echo sPermissionCommand
oShell.Run sPermissionCommand
------------------------------------------------------------------


Please log in to comment