namespace exception


greetings!
 
i installed dotnetfx35, windowsxp-kb926139-v2-x86-enu.exe using administrator priveleges on xp-pro os.  found several scripts inflate compressed files in a folder. created profile reset the set-executionpolicy remotesigned.
the script: unzipfolder.ps1

$shell=new-object -com shell.application

$currentlocation=get-location

$currentpath=$currentlocation.path

$location=$shell.namespace($currentpath)

$zipfiles = get-childitem *.zip

$zipfiles.count | out-default

foreach ($zipfile in $zipfiles)

{

$zipfile.fullname | out-default

$zipfolder = $shell.namespace($zipfile.fullname)

$location.copyhere($zipfolder.items())

}



 

on execution, see ... repeated each zip file in folder:

exception calling "namespace" "1" argument(s): "the system cannot find file specified. (exception hresult: 0x80070002)"
at c:\foo\unzipfolder.ps1:19 char:30
+$zipfolder = $shell.namespace( <<<<  $zipfile.fullname)
you cannot call method on null-valued expression.
at c:\foo\unzipfolder.ps1:21 char:36
$locatin.copyhere($zipfolder.items( <<<< ))


but get-location resolves ok, get-childitem resolves ok. 


q1) namespace looking different location (default root/cimvc2 page 58 primer)?
q2) version 2 versus version 1 issue?
q3) expected supply parameter?

i appreciate pointers reference material me understand diagnosis of exceptions

thanks help

so, mentioned kiron on newsgroop, here might unsupported (by com class) compression format. try pack file standart zip folder , extract code. must work.
[тут могла быть ваша реклама] http://www.sysadmins.lv


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group