Jump to content


  • 0
RedDR

Bringing a window forward

Question

Geez, im a roll with all these asking Questions!!!

 

Heres my latest.

 

Ive written a vbs script to pull out the bios make and serial number as thats the naming convention here.

 

So basically

Grabs Make and Serial

Strips make down to 4 chars

Combines the two

Asks the user is this ok?

If its ok .. continue on

If its not .. get them to input

 

Now .. the script works great, but when i whack it in the TS and get it to run, the input dialog boxis hidden behind the TS (Installation Progress) window. Seems the TS window is set to Always on Top or something like that

 

I tried to hide this window just for that task by

Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)

ProgressUI.CloseProgressDialog

 

No good.

 

 

Heres my script, any thoughts on how I can achieve this? It would be great just to hide that window for that specific task so the user can do this.

 

 

 

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

 

Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)

ProgressUI.CloseProgressDialog

 

 

Dim objWMI : Set objWMI = GetObject("winmgmts:")

Dim colSettingsComp : Set colSettingsComp = objWMI.ExecQuery("Select * from Win32_ComputerSystem")

Dim colSettingsBios : Set colSettingsBios = objWMI.ExecQuery("Select * from Win32_BIOS")

Dim objComputer, strModel, strSerial, strComputerName

 

For each objComputer in colSettingsComp

strModel = objComputer.Model

Next

 

For Each objComputer in colSettingsBios

strSerial = objComputer.SerialNumber

Next

 

strComputerName = Left(strModel,4) & strSerial

 

If MsgBox ("Is this computername Correct? " & strComputername, vbYesNo) = vbNo then

strComputerName = InputBox("Please correct the computer name" & (Chr(13) & Chr(10)) & (Chr(13) & Chr(10)) & "The computer name is the first 4 numbers of the model and serial number combined","Confirmation Required",strComputerName)

if strComputerName = "" then strComputerName = Left(strModel,4) & strSerial

End If

 

'MsgBox ("This is the computer name being set " & strComputername)

 

set env = CreateObject("Microsoft.SMS.TSEnvironment")

env("OSDComputerName") = strComputerName

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

and the solution was ... :)

 

The solution was to pay attention, slow down, take care in what im doing, stop trying to work so quick.

 

Id modified the vbs, updated the distribution point, but kicked off the deployment of a machine right away, If I had of waited just 5 minutes, it would have gone through successfully.

 

The DP was upset. So double, triple checked and hit it again, went through beautifully.

 

The code works fine

 

 

Ok, onto packaging some apps

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.