How can I change this so the path is a UNC path to c:\images?

Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile where
Path = '\\images\\'")

Any help is greatly appreciated, thanks!

Re: Change where my ("Select * from CIM_DataFile where Path = '\\images\\'") by Torgeir

Torgeir
Wed Sep 15 12:51:38 CDT 2004

Joshua C. Clark wrote:

> How can I change this so the path is a UNC path to c:\images?
>
> Set objWMIService = GetObject("winmgmts:" &
> "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile where
> Path = '\\images\\'")
>
> Any help is greatly appreciated, thanks!
Hi

Sorry, CIM_DataFile doesn't support UNC (it might work if you
map a drive letter to your UNC address first and use that one
instead) ...



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Change where my ("Select * from CIM_DataFile where Path = '\\images\\'") to a UNC path by Joshua

Joshua
Wed Sep 15 12:56:32 CDT 2004

Hmm, any ideas how I could do that?

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:eGAy2y0mEHA.896@TK2MSFTNGP12.phx.gbl...
> Joshua C. Clark wrote:
>
> > How can I change this so the path is a UNC path to c:\images?
> >
> > Set objWMIService = GetObject("winmgmts:" &
> > "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> > Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile where
> > Path = '\\images\\'")
> >
> > Any help is greatly appreciated, thanks!
> Hi
>
> Sorry, CIM_DataFile doesn't support UNC (it might work if you
> map a drive letter to your UNC address first and use that one
> instead) ...
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx



Re: Change where my ("Select * from CIM_DataFile where Path = '\\images\\'") by Torgeir

Torgeir
Wed Sep 15 13:16:47 CDT 2004

Joshua C. Clark wrote:


> "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote:
>
>> Sorry, CIM_DataFile doesn't support UNC (it might work if you
>> map a drive letter to your UNC address first and use that one
>> instead) ...
>>
>>
> Hmm, any ideas how I could do that?
Hi

E.g. WSH's MapNetworkDrive method


WSH 5.6 documentation (local help file) can be downloaded from
here if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp

--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: Change where my ("Select * from CIM_DataFile where Path = '\\images\\'") to a UNC path by Joshua

Joshua
Wed Sep 15 13:23:57 CDT 2004

I re wrote it a little..

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3

strDirectoryPath="c:\images\"
Set objFileScripting = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFileScripting.GetFolder("c:\images\")
Set filecollection = objFolder.Files
For Each filename in filecollection

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DSN=Images;"
objRecordset.CursorLocation = adUseClient
objRecordset.Open "SELECT * FROM Images" , objConnection, adOpenStatic,
adLockOptimistic
objRecordset.AddNew

Filename=right(Filename,len(Filename)-InStrRev(Filename, "\"))
objRecordset("Filename") = filename
objRecordset.Update

Next

objRecordset.Close
objConnection.Close

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:O70D6A1mEHA.2340@TK2MSFTNGP11.phx.gbl...
> Joshua C. Clark wrote:
>
>
> > "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote:
> >
> >> Sorry, CIM_DataFile doesn't support UNC (it might work if you
> >> map a drive letter to your UNC address first and use that one
> >> instead) ...
> >>
> >>
> > Hmm, any ideas how I could do that?
> Hi
>
> E.g. WSH's MapNetworkDrive method
>
>
> WSH 5.6 documentation (local help file) can be downloaded from
> here if you haven't got it already:
> http://msdn.microsoft.com/downloads/list/webdev.asp
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx