/build/static/layout/Breadcrumb_cap_w.png

Question: Removing laptop system password via script

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


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
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 ------------------------------------------------------------------
Posted by: Dedge77 12 years ago
Orange Belt
2

Okay I have managed to resolve this eventually.  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

------------------------------------------------------------------

Im sure someone with more knowledge of VBScript than me (can't be hard) will have a look at this butchers script and want to make it look prettier but if it helps someone else then thats cool with me.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ