
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2008 11:49 PM
Here is a custom action I setup so that we can change the computer description.
and here is the VBscript code:
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
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
Labels:
- Labels:
-
Custom Actions
31 REPLIES 31

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2008 06:16 PM
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.
interesting that you had to strip out the cmd.exe, mine works fine. wonder how others will be effected.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2008 02:42 PM
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.
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
