Re: current working directory when uncompressed in XP

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 04/06/04


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



Relevant Pages

  • Re: Problems after SBS_SP1
    ... just the folder and a compressed file.. ... >> We need to extract SBS SP1 installation folders, ... >> Integrated setup program to the folder for the 'SP1 CD3' contents. ... >> install process without cleaning up the extracted files. ...
    (microsoft.public.windows.server.sbs)
  • =?Utf-8?Q?Re:_Tricky_.dbxs=C2=B4...?=
    ... The only program that might get the messages is DBXpress. ... Only it has the extract from disk function (you wasted your money on the other programs. ... going back to Local Folder view, ... I copied whatever dbx files File Scavenger could dig out, ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Problems after SBS_SP1
    ... original CD3 to the same folder in the extracted folder. ... KB841876 and finally the SBS SP1. ... >>> We need to extract SBS SP1 installation folders, ...
    (microsoft.public.windows.server.sbs)
  • Re: Inbox has dissappeared
    ... I have tried every way I know of and I believe that the dbx file is empty. ... Using DBXpress to extract messages from dbx files is not recommended for my ... >I made sure to drag out the Temp Inbox.dbx file from the OE store>folder. ... I opened the OE store folder and saw that the Temp ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Outlook Express "compressed" mail - where did it go?
    ... This is a slow process, particularly with large hard drives, so be patient. ... To extract from an entire hard drive, click on the Drive radio button to select that option. ... Note again that this is a slow process, as every byte on the hard drive is analyzed. ... foldername.dbx". ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)

Loading