Re: current working directory when uncompressed in XP
From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 04/06/04
- Next message: Al Dunbar [MS-MVP]: "Re: Help with Variables that Vary"
- Previous message: Michael H: "Re: Help with Variables that Vary"
- In reply to: nik: "current working directory when uncompressed in XP"
- Next in thread: nik nik: "Re: current working directory when uncompressed in XP"
- Reply: nik nik: "Re: current working directory when uncompressed in XP"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 5 Apr 2004 21:44:34 -0600
"nik" <nikhilb@prodilink.com> wrote in message
news:157ec01c41b19$3a7e8900$a601280a@phx.gbl...
> Folks...
>
> have a strange wsh (vbscript) problem.
Note really specific to WSH - consider running other forms of executables in
the same manner...
> basically i am trying to run a wsf file , which is in zip
> format. on XP , i use the XP's built in uncompress
> mechanism and it opens the zip file and displays its
> contents...(the files). And when I click on the wsf file
> to execute it, it executes fine...until a point where its
> looking to copy a file from the same unzipped file into
> windows directory. thats where it bails out...giving file
> not found exception.
Where is your script expecting to find this file? If you are relying on it
being simply in "the current directory", that could be the problem...
> from what i hear when you run a wsf file, the windows
> scripting host runs from the same directory where the file
> is and hence you can do currentWorkgingdirectory and get
> the path of other files in the same folder as the wsf
> file. But in the case which is just described above, on
> XP, after being uncompressed, i cannot determine what the
> directory from where i am running the wsf file.
Thing is, it's not really a directory, explorer simply emulates one for you
when you navigate into a .zip folder.
I did a quick test in batch and have found that each invocation of a batch
file in a .zip folder seemed to extract the batch file to a folder created
for the purpose in the %temp% directory. I then included a data file in the
.zip to see if it would also appear in the temp folder. It didn't (a good
thing too - unless you would want it to implicitly extract ALL files from
ANY size zip file EVERY time you ran ONE of the scripts, even if you did not
need them), but it popped up a dialog message saying:
"this application may depend on other compressed files in this folder. For
the application to run properly, it is recommended that you first extract
all files."
Presumably this comes from CMD.EXE (a native NT executable), whereas the WSH
executable may not have been specifically programmed to give such a hint.
> any pointers will be appreciated.
All you need to do is to have your script figure out where it might have
been extracted from, and then have it explicitly extract what you need.
Unfortunately, it is not clear how to map back from the temp extraction
folder to the original .zip folder. This might be in the registry, but a
simple search did not find it.
/Al
- Next message: Al Dunbar [MS-MVP]: "Re: Help with Variables that Vary"
- Previous message: Michael H: "Re: Help with Variables that Vary"
- In reply to: nik: "current working directory when uncompressed in XP"
- Next in thread: nik nik: "Re: current working directory when uncompressed in XP"
- Reply: nik nik: "Re: current working directory when uncompressed in XP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|