Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

win32_process type name not found in system.management.managementc

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 07-11-2007   #1 (permalink)
Alan
Guest


 

win32_process type name not found in system.management.managementc

I am new to powershell and was trying to use powershell to install/uninstall
services on a remote machine. the command i was using to create a
win32_process is:

PS C:\> $mc = new-object system.management.managementclass
\root\cimv2:win32_process

This command was working fine untill earlier today and i was messing around.
I found out that i executed this line:

PS C:\> $mc.delete()

and now when i try to create a new win32_process i get this exception:

New-Object : Exception retrieving the type name hierarchy: "Not found ".
At line:1 char:11
+ new-object <<<< system.management.managementclass \root\cimv2:win32_process

This is really weird, has anybody seen this before? i dont know what to do.

Thanks for the help.

My System SpecsSystem Spec
Old 07-12-2007   #2 (permalink)
/\/\o\/\/ [MVP]
Guest


 

RE: win32_process type name not found in system.management.managementc

You did remove the win32_progress CLASS from the WMI repository.

one option is to stop the WMI service and delete the following directory :

%windir%\system32\wbem\repository

and restart WMI service, the repository will be re-build again

or you can just re-compile the cimwin32.mof file to add the classes in there
again

the first option is a bit more brute-force but easier without the WMI
knowledge

Greetings /\/\o\/\/
http:\\thePowerShellGuy.com


"Alan" wrote:

> I am new to powershell and was trying to use powershell to install/uninstall
> services on a remote machine. the command i was using to create a
> win32_process is:
>
> PS C:\> $mc = new-object system.management.managementclass
> \root\cimv2:win32_process
>
> This command was working fine untill earlier today and i was messing around.
> I found out that i executed this line:
>
> PS C:\> $mc.delete()
>
> and now when i try to create a new win32_process i get this exception:
>
> New-Object : Exception retrieving the type name hierarchy: "Not found ".
> At line:1 char:11
> + new-object <<<< system.management.managementclass \root\cimv2:win32_process
>
> This is really weird, has anybody seen this before? i dont know what to do.
>
> Thanks for the help.

My System SpecsSystem Spec
Old 07-12-2007   #3 (permalink)
Alan
Guest


 

RE: win32_process type name not found in system.management.managem

It worked. I have another quick question for you. I am using powershell for
automation and after i uninstall the windows service how can i delete the
..exe file afterwards?

Thanks again for the help /\/\o\/\/

"/\/\o\/\/ [MVP]" wrote:

> You did remove the win32_progress CLASS from the WMI repository.
>
> one option is to stop the WMI service and delete the following directory :
>
> %windir%\system32\wbem\repository
>
> and restart WMI service, the repository will be re-build again
>
> or you can just re-compile the cimwin32.mof file to add the classes in there
> again
>
> the first option is a bit more brute-force but easier without the WMI
> knowledge
>
> Greetings /\/\o\/\/
> http:\\thePowerShellGuy.com
>
>
> "Alan" wrote:
>
> > I am new to powershell and was trying to use powershell to install/uninstall
> > services on a remote machine. the command i was using to create a
> > win32_process is:
> >
> > PS C:\> $mc = new-object system.management.managementclass
> > \root\cimv2:win32_process
> >
> > This command was working fine untill earlier today and i was messing around.
> > I found out that i executed this line:
> >
> > PS C:\> $mc.delete()
> >
> > and now when i try to create a new win32_process i get this exception:
> >
> > New-Object : Exception retrieving the type name hierarchy: "Not found ".
> > At line:1 char:11
> > + new-object <<<< system.management.managementclass \root\cimv2:win32_process
> >
> > This is really weird, has anybody seen this before? i dont know what to do.
> >
> > Thanks for the help.

My System SpecsSystem Spec
Old 07-12-2007   #4 (permalink)
Alan
Guest


 

RE: win32_process type name not found in system.management.managem

I forgot to add that I am doing on a remote machine from a build server.

"Alan" wrote:

> It worked. I have another quick question for you. I am using powershell for
> automation and after i uninstall the windows service how can i delete the
> .exe file afterwards?
>
> Thanks again for the help /\/\o\/\/
>
> "/\/\o\/\/ [MVP]" wrote:
>
> > You did remove the win32_progress CLASS from the WMI repository.
> >
> > one option is to stop the WMI service and delete the following directory :
> >
> > %windir%\system32\wbem\repository
> >
> > and restart WMI service, the repository will be re-build again
> >
> > or you can just re-compile the cimwin32.mof file to add the classes in there
> > again
> >
> > the first option is a bit more brute-force but easier without the WMI
> > knowledge
> >
> > Greetings /\/\o\/\/
> > http:\\thePowerShellGuy.com
> >
> >
> > "Alan" wrote:
> >
> > > I am new to powershell and was trying to use powershell to install/uninstall
> > > services on a remote machine. the command i was using to create a
> > > win32_process is:
> > >
> > > PS C:\> $mc = new-object system.management.managementclass
> > > \root\cimv2:win32_process
> > >
> > > This command was working fine untill earlier today and i was messing around.
> > > I found out that i executed this line:
> > >
> > > PS C:\> $mc.delete()
> > >
> > > and now when i try to create a new win32_process i get this exception:
> > >
> > > New-Object : Exception retrieving the type name hierarchy: "Not found ".
> > > At line:1 char:11
> > > + new-object <<<< system.management.managementclass \root\cimv2:win32_process
> > >
> > > This is really weird, has anybody seen this before? i dont know what to do.
> > >
> > > Thanks for the help.

My System SpecsSystem Spec
Old 07-12-2007   #5 (permalink)
/\/\o\/\/ [MVP]
Guest


 

RE: win32_process type name not found in system.management.managem

I can not give a faultproof solution, becouse of the way services work :

there is a way to list the exes called directly, but it would only work for
Own Process services and for the command that get's invoked

gwmi win32_service | group ServiceType

to find out and list startup path for all 'Own Process' services :

gwmi win32_service |? {$_.ServiceType -eq 'Own Process'} | ft name,pathname

look for youself if this will work in our case

h.t.h.

Greetings /\/\o\/\/

"Alan" wrote:

> It worked. I have another quick question for you. I am using powershell for
> automation and after i uninstall the windows service how can i delete the
> .exe file afterwards?
>
> Thanks again for the help /\/\o\/\/
>
> "/\/\o\/\/ [MVP]" wrote:
>
> > You did remove the win32_progress CLASS from the WMI repository.
> >
> > one option is to stop the WMI service and delete the following directory :
> >
> > %windir%\system32\wbem\repository
> >
> > and restart WMI service, the repository will be re-build again
> >
> > or you can just re-compile the cimwin32.mof file to add the classes in there
> > again
> >
> > the first option is a bit more brute-force but easier without the WMI
> > knowledge
> >
> > Greetings /\/\o\/\/
> > http:\\thePowerShellGuy.com
> >
> >
> > "Alan" wrote:
> >
> > > I am new to powershell and was trying to use powershell to install/uninstall
> > > services on a remote machine. the command i was using to create a
> > > win32_process is:
> > >
> > > PS C:\> $mc = new-object system.management.managementclass
> > > \root\cimv2:win32_process
> > >
> > > This command was working fine untill earlier today and i was messing around.
> > > I found out that i executed this line:
> > >
> > > PS C:\> $mc.delete()
> > >
> > > and now when i try to create a new win32_process i get this exception:
> > >
> > > New-Object : Exception retrieving the type name hierarchy: "Not found ".
> > > At line:1 char:11
> > > + new-object <<<< system.management.managementclass \root\cimv2:win32_process
> > >
> > > This is really weird, has anybody seen this before? i dont know what to do.
> > >
> > > Thanks for the help.

My System SpecsSystem Spec
Closed Thread
Update your Vista Drivers Update Your Drivers Now!!

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Unable to cast COM object of type 'ADODB.RecordsetClass' to class type 'System.Object[]' Michel Posseth [MCP] .NET General 2 03-27-2008 10:04 AM
The type or namespace 'PSSnapIn' could not be found junker37 PowerShell 7 03-23-2008 12:49 AM
RC2 - where has System.Management.Automation.dll gone? =?Utf-8?B?QW5kcmV3IFdlYmI=?= PowerShell 5 01-10-2008 12:43 AM
Win32_Process create method mpriem PowerShell 5 07-16-2007 07:04 AM
Issues with System drive in Disk Management on a Dual Boot system =?Utf-8?B?dGhpbHRvbg==?= Vista General 4 07-09-2006 06:26 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51