/build/static/layout/Breadcrumb_cap_w.png

Using VBS and CCTK.exe for BIOS changes, how to include parameters

Hi,

We have a company with a few hundred pc's
We would like to change the asset tag of our excisting pc's and we think cctk can be a great for that.

I'm not that great at scripting so i really would appreciate a experts look at my problem.. ;-)

I have two questions
1. Is there someone who could tell me how to (correctly) include the parameter (--asset) in the script ?
2. My current script gives me this error: Line 11, System cannot find file.
Code: 80070002
Source: WshShell.Exec

Script:
1 Option Explicit
2
3 const COMMAND_EXEC = "C:\Asset\cctk.exe"
4
5 dim objExec, objWshShell, objStdOut
6 dim strComputerName, strResult
7
8 set objWshShell = CreateObject("WSCript.Shell")
9 strComputerName = objWshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
10
11 set objExec = objWshShell.Exec (COMMAND_EXEC & "--asset=" & strComputerName)
12 set objStdOut = objExec.StdOut
13
14 strResult = objStdOut.ReadAll
15 WScript.Echo strResult
16
17 set objExec = nothing
18 set objWshShell = nothing
19 set objStdOut = nothing

0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Just giving this a quick look try adding a space in front of the --asset. From this: 11 set objExec = objWshShell.Exec (COMMAND_EXEC & "--asset=" & strComputerName) To this: 11 set objExec = objWshShell.Exec (COMMAND_EXEC & " --asset=" & strComputerName) If not the command line when expanded becomes: C:\Asset\cctk.exe--asset=hostname
Posted by: dchristian 12 years ago
Red Belt
3
Just giving this a quick look try adding a space in front of the --asset.
From this:
11 set objExec = objWshShell.Exec (COMMAND_EXEC & "--asset=" & strComputerName)
To this:
11 set objExec = objWshShell.Exec (COMMAND_EXEC & " --asset=" & strComputerName)

If not the command line when expanded becomes:
C:\Asset\cctk.exe--asset=hostname

Comments:
  • dchristian, thank you so much for your help !!
    Finally the script works fine !! - Mesjoggah 12 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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