→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ejensen
Engaged Sweeper III
Here is a custom action I setup so that we can change the computer description.
cmd.exe cscript \\SERVER\SHARE\change_comp_desc.vbs {computer}


and here is the VBscript code:

Set WshNetwork = WScript.CreateObject("WScript.Network")

strComputer = Wscript.Arguments.Item(0)
strDescription = Inputbox("Enter Description:")

Set Obj= GetObject("winmgmts:\\" & strComputer).InstancesOf("Win32_OperatingSystem")
For Each x In Obj
x.Description = strDescription
x.Put_
Next

WScript.Quit


Pops up an input box for you to enter the computer description.
Please let me know if anyone sees anything that could be improved with this script or custom action.

thanks,
Eric
31 REPLIES 31
ejensen
Engaged Sweeper III
yeah, sorry about the type-o there. i fixed it in the original post.

interesting that you had to strip out the cmd.exe, mine works fine. wonder how others will be effected.
Optilan
Engaged Sweeper
That's a really good idea, why didnt i think of it!

I got it to work but i needed to change the following:

strComputer is defined at the top as strCOmputer.

Also i needed to change the Action to just begin with cscript and strip off the cmd.exe for some reason, i know it shouldnt make any difference, but just incase anyone else gets the same problem, it was just bringing up the command prompt before i changed it.

Thanks for this ejensen.
Optilan Communication Systems www.optilan.com