"Destination is not a directory"-ERROR??

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
SuzyQJax
Posts: 16
Joined: 05 Mar 2010 12:34

"Destination is not a directory"-ERROR??

#1 Post by SuzyQJax » 05 Mar 2010 12:52

Hey Dos Guys!
Been working with cab files at work to extract and expand them to a desktop folder for the end user.
I have tried and tried to expand the cab folder to the desktop but always get the "Destination is not a directory"
error message,(Is the Desktop not considered a directory?) so I just made the below working batch to expand
to the system root drive first then copy over to desktop.However, I would like to streamline the code to just go
straight to the Desktop like my orginal plan.Again I can Copy,Remove and Delete from desktop from standard
commands but just can't get the Expand command to recognize the desktop..

If Anyone could use my exsisting code to get it to work to the Desktop would be greatly appreciated!
Thanks ...SuzyQ :-) :P

[/code]@Echo Off
color 02
@echo =============================================================================
@echo Make directories, Copy/Expand Cab file, Then copy extracted files to desktop.
@echo =============================================================================
echo.
echo.
::
md "%systemdrive%\Software"
md "%Homepath%\Desktop\Software"
::
expand %windir%\system32\Cabs\software.cab %systemdrive%\software\ -f:*
::
xcopy "%systemdrive%\Software\*.*" "%Homepath%\Desktop\Software"/s /q /v /y
::
rd "%systemdrive%\software"/s /q
echo.
echo.
::
@echo Operation Completed Successfully!
@echo +++++++++++++++++++++++++++++++++
echo.
echo.
pause
Exit
::rev.03.02.10[/code]

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

Re: "Destination is not a directory"-ERROR??

#2 Post by aGerman » 06 Mar 2010 13:13

Maybe I'm wrong, but try to remove the back slash behind "software" and place option -f before the destination.

Code: Select all

expand %windir%\system32\Cabs\software.cab -f:* %systemdrive%\software


Regards
aGerman

SuzyQJax
Posts: 16
Joined: 05 Mar 2010 12:34

Re: "Destination is not a directory"-ERROR??

#3 Post by SuzyQJax » 06 Mar 2010 17:47

Thanks for the quick reply aGerman :P
As I said the script that I posted works with the expand path as listed to the C: root drive then xcopy over to the desktop but I want to just expand Straight to the Desktop.I tried your path as suggested
expand %windir%\system32\Cabs\software.cab -f:* %Homepath%\Desktop\Software but I still get the following error: "Destination is not a directory: Settings\Owner\Desktop\Software" It reads Settings and not Documents and Settings so that may be the Problem, anymore Ideas would be really appreciated...
btw -f:* can go either way at the end of path or as you suggested.
SuzyQ

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

Re: "Destination is not a directory"-ERROR??

#4 Post by aGerman » 06 Mar 2010 18:59

I see. Why don't you use quotes in this line?

Code: Select all

expand "%windir%\system32\Cabs\software.cab" -f:* "%Homepath%\Desktop\Software"


Regards
aGerman

SuzyQJax
Posts: 16
Joined: 05 Mar 2010 12:34

Re: "Destination is not a directory"-ERROR??

#5 Post by SuzyQJax » 06 Mar 2010 21:09

Thanks!!! aGerman the quotes did the trick, seems when expanding to the systemdrive you don't need the quotes but when going to the desktop thru a user account you do ,go figure
life is good again .. :wink:

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

Re: "Destination is not a directory"-ERROR??

#6 Post by aGerman » 07 Mar 2010 08:44

The reason is simple. If there is any space in the path or file name then you have to use quotes. Otherwise it doesn't matter if you use quotes.

Post Reply