mseely
Posts: 35
Score: 1 Joined: 5/4/2008 Status: offline
|
A basic VBScript file that will do what is being asked is here: [Basic in that there is no error checking, no return codes, etc] (also, on my VISTA system, I noticed that the MS_INSTANCE_VIEW_PROVIDER had not been registered on the system yet, so I needed to register the Provider in order for it to work) --Mark --- CONST TemporaryFolder = 2 Set ofso = CreateObject("Scripting.FileSystemObject") Set oWNet = CreateObject("Wscript.Network") Set oWshell = CreateObject("Wscript.Shell") TempFolder = ofso.GetSpecialFolder(TemporaryFolder) curFolder = ofso.GetParentFolderName(wscript.scriptfullname) if ofso.FileExists(ofso.BuildPath(curFolder,"LocalAdmin.MOF")) Then Set inFile = ofso.OpenTextFile(ofso.BuildPath(curFolder,"LocalAdmin.MOF")) szMOF = inFile.ReadAll szMOF = Replace(szMOF,"BUILTIN",oWNet.ComputerName) inFile.Close Set outFile = ofso.CreateTextFile(ofso.BuildPath(TempFolder,"LocalAdmin.MOF")) outFile.Write szMOF outFile.Close TempMOF = ofso.BuildPath(curFolder,"LocalAdmin.MOF") if ofso.FileExists(TempMOF)) then owshell.Run "MOFCOMP.EXE " & CHR(34) & TempMOF & chr(34),,1 ofso.DeleteFile TempMOF,vbtrue end If end if ---
< Message edited by mseely -- 5/26/2008 5:05:56 PM >
|