Re: mofcomp related question

Tech-Archive recommends: Fix windows errors by optimizing your registry



On May 6, 4:28 am, vidyasagar....@xxxxxxxxx wrote:
Hi all,

Is there any silent mode to registering a .moffile with mofcomp? I
dont want a command line to come up when I execute that command. Any
ideas?

Can you use vbscript? something like the below, where the mini.mof
file is in the same folder as the vbscript.

On Error Resume Next
Set sho = CreateObject("WScript.Shell")
strSystemRoot = sho.expandenvironmentstrings("%SystemRoot%")
strCurrentDir = Left(Wscript.ScriptFullName,
(InstrRev(Wscript.ScriptFullName, "\") -1))
'Parse Command Line
strAddWMIClasses = strSystemRoot & "\System32\wbem\mofcomp " & chr(34)
& strCurrentDir & "\MINI.mof" & chr(34)
sho.run "cmd /c " & strAddWMIClasses,vbHide
.



Relevant Pages

  • Re: Need WMI script
    ... Error handling in VBScript is obviously not as good as in .NET. ... normal error handling with "On Error GoTo 0". ... Dim adoCommand, adoConnection, strBase, strFilter, strAttributes, xmlDoc, ... you can use a command similar to below at a command ...
    (microsoft.public.windows.server.scripting)
  • Re: Need WMI script
    ... How to handle the errors in vbscript. ... Dim strDomainName, strNodeText, strXmlBuilder ... However, if you use the cscript host, ... you can use a command similar to below at a command prompt: ...
    (microsoft.public.windows.server.scripting)
  • Re: wsharguments length limit?
    ... pasted it into a batch file, changed the path to the VBScript to one on my ... When I pasted your command I noted there were spaces between each argument, ... Could SAS be ... Set objXL = WScript.CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: system.Diagnostics.Process Problem
    ... Dim consoleApp As New Process ... Loop Until consoleApp.MainWindowTitle.ToString.EndsWith ... command sent to the cmd.exe) but I am not clear on your response. ... then attempt to read the output from the VBScript using ...
    (microsoft.public.dotnet.general)
  • Re: system.Diagnostics.Process Problem
    ... Thanks for you response. ... processing the previous command that was sent so that I may send another one. ... Dim objProcess As Process ... EndOfStream is not reached when VBScript ends only when cmd.exe ...
    (microsoft.public.dotnet.general)