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
[/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]
"Destination is not a directory"-ERROR??
Moderator: DosItHelp
Re: "Destination is not a directory"-ERROR??
Maybe I'm wrong, but try to remove the back slash behind "software" and place option -f before the destination.
Regards
aGerman
Code: Select all
expand %windir%\system32\Cabs\software.cab -f:* %systemdrive%\software
Regards
aGerman
Re: "Destination is not a directory"-ERROR??
Thanks for the quick reply aGerman
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
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
Re: "Destination is not a directory"-ERROR??
I see. Why don't you use quotes in this line?
Regards
aGerman
Code: Select all
expand "%windir%\system32\Cabs\software.cab" -f:* "%Homepath%\Desktop\Software"
Regards
aGerman
Re: "Destination is not a directory"-ERROR??
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 ..
life is good again ..
Re: "Destination is not a directory"-ERROR??
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.