EXPAND.EXE does not extract files Windows 7 (starter)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
miskox
Posts: 631
Joined: 28 Jun 2010 03:46

EXPAND.EXE does not extract files Windows 7 (starter)

#1 Post by miskox » 21 Nov 2015 14:53

Hi all!

I am having probems with this viewtopic.php?p=39196#p39196 . It runs OK (creates all .chr files) on XP but on Windows 7 Starter it does not work at all. Error message I get is:

Code: Select all

Expanding File chrsdec.ca_ Incomplete. Error Code=0x800700a1
Error Description: Path not found (this error is in local language so the translation might be wrong)


Of course target directory exists.

Any ideas?

Thanks.
Saso

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#2 Post by aGerman » 22 Nov 2015 09:11

If the path can't be found it seems that either the path does really not exist (eg. the file was deleted) or you try to access a path that isn't in the Environment of your Batch file.
Three things I can think of:
1) Your Anti Virus detected a false positive and deleted files that were created. Try to temporarily deactivate your Anti Virus software.
2) Your working directory changed. E.g. if you "Run as Administrator" the working directory is automatically set to %SystemRoot%\system32. Write line @cd /d "%~dp0" at the beginning of your code.
3) Because you're working on a 64 Bit system (?) and you call your batch file from within a 32 Bit process (?) the WOW64 subsystem is active. The result is that the environment changes.

Regards
aGerman

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#3 Post by penpen » 22 Nov 2015 15:18

@aGerman:
I currently have the same problem on my Win 8.1 32 bit (points 1 to 3 are "innocent").

@miskox:
The program "expand.exe" just doesn't like your cabinet file; but i cannot give a solution because i don't know why:
The stored files could be extracted from "chrsDEC.ca_" with no errors using the shell-context-menue (if renamed to "chrsDEC.cab", so it should be valid.
Expand also doesn't work on (renamed "chrsDEC.ca_" ==>) "chrsDEC.cab".


Sidenotes:
The cab-file ("chrsDEC.ca_") still works on WinXP, so it is definitely valid.
It is no good solution to create a vbs file named "chrsDEC.cab" it works, but was very irritating.


penpen

Edit: Added the Sidenotes section.

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#4 Post by penpen » 22 Nov 2015 15:54

Solved it (at leasst for my win 8.1); you must use the "-i" switch:

Code: Select all

Expand chrsDEC.ca_ -F:*.chr _chrs_ -i>nul 2>nul
Why? Don't know:
The extracted directory structure is the same within the cab file and in the target directory. (".\0.chr" - ".\255.chr").


penpen

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#5 Post by aGerman » 22 Nov 2015 16:11

I have to admit that I didn't even test it. Now that penpen already confirmed this behavior I had a look into the created cabinet file. It appears that all files are compressed in a folder with name "." which is no valid name. Under XP it seems to be interpreted as "." for "current folder" but later Windows versions seem to interpret it as a real folder name and diagnose its invalidity. Since option -i ignores the directory tree it all makes sense now...

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#6 Post by Ed Dyreen » 22 Nov 2015 18:16

Seems like later versions of windows are breaking things rather than improving current technologies. Of course the dot should be interpreted as a regular expression and not taken literally. Windows can know this because a dot is not a valid fileName. To me this is just yet another bug.

miskox
Posts: 631
Joined: 28 Jun 2010 03:46

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#7 Post by miskox » 23 Nov 2015 02:55

Thank you all!

I re-created the .cab file with the _chrs_ folder in it and now it works on Win7.

The command I used is:

Code: Select all

expand cabinet_file.cab -F:*.chr .


If I use

Code: Select all

expand cabinet_file.cab -F:*.chr _chrs_


I then have a folder _chrs_ with _chrs_ subfolder.

But...

If I use the same command on XP it does not work. Expand.exe extracts files to the current directory if I use a dot - expand.exe on XP does not extract to the folder in the cabinet file.

What can I do to have ONE command for both platforms?

Saso

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#8 Post by aGerman » 23 Nov 2015 10:33

Did you try penpen's proposal to use your original cab file (with dot folder) and option -i ?

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#9 Post by penpen » 23 Nov 2015 10:36

I wouldn't have changed the cabinet file (only its name); because i don't know if the "expand.exe" from vista behaves like winxp's one or not, i would prefer something like this:

Code: Select all

Expand chrsDEC.ca_ -F:*.chr _chrs_>nul 2>nul || Expand chrsDEC.ca_ -F:*.chr _chrs_ -i>nul 2>nul


penpen

miskox
Posts: 631
Joined: 28 Jun 2010 03:46

Re: EXPAND.EXE does not extract files Windows 7 (starter)

#10 Post by miskox » 23 Nov 2015 12:35

@aGerman: I did not try Penpen's -i solution (don't know why - maybe because expand -? does not show it (XP).

@penpen: I will test both your solutions tomorrow (currently I only have a computer with XP and not with Win7 at hand). (Though I don't understand your second solution (aren't they the same?) - should a _chrs_ folder exist prior to the expand command? Maybe more will be clear tomorrow when I have both systems available).

Thank you all.
Saso

Update:

@Penpen: your solution works. Thanks.

Post Reply