WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WMI
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntGetCon using WMI


Question:

Does anyone know a nice way to do what WntGetCon does w/o having to use the extender? I have a script written, and the only call that is in it that requires the wnt extender is wntGetcon. I'm trying to avoid having to include another DLL in the distro.

I've thought about piping the 'net use' output to a text file and disecting it, but didn't know if there was a cleaner way to do it.

Answer:

Here is some WMI code that can get that info:
driveletter = "z:"
objSvc = ObjectGet("Winmgmts:\\.\root\cimv2") 
objEnum = objSvc.ExecQuery(StrCat("Select * from win32_logicaldisk where DeviceId = '", driveletter,"'"), "WQL", 48) 
ForEach obj in objEnum 
    Message(driveletter, obj.providername )
next
objEnum = 0
objSvc = 0

Article ID:   W17325
File Created: 2007:07:03:14:29:30
Last Updated: 2007:07:03:14:29:30