user2302725
user2302725

Reputation: 473

Batch - Create zip archive without keeping original path

I'm trying to create a zip archive by executing this command line :

"C:\Program Files\WinRAR\WinRAR.exe" a -afzip "C:\Users\toto\Desktop\file.zip" "C:\Users\toto\workspace\thing\trunk\chrome" "C:\Users\toto\workspace\thing\trunk\defaults"

The file.zip is created on the desktop as wanted but when I open the archive I find the whole path to access the chrome and defaults directories. It is "Users\toto\workspace\thing\trunk" I'd like to have directly my chrome and defaults directories as first nodes in the archive. Is is possible ?

Upvotes: 0

Views: 1036

Answers (3)

Mofi
Mofi

Reputation: 49186

It is interesting to read this question as about 50% of all answers given on questions tagged with the WinRAR tag contain either switch -ep or -ep1.

For example:

It looks like many WinRAR users prefer asking over searching or looking in help of WinRAR or reading command line documentation Rar.txt in program files directory of WinRAR.

It might be helpful to answer this frequently asked WinRAR related question already in winrar tag wiki.

Upvotes: 0

MC ND
MC ND

Reputation: 70951

Add -ep1 switch to your command

Upvotes: 3

Mark Setchell
Mark Setchell

Reputation: 208003

Just cd there first:

cd \Users\toto\workspace\thing\trunk

then make it

"C:\Program Files\WinRAR\WinRAR.exe" a -afzip "C:\Users\toto\Desktop\file.zip" chrome defaults

Upvotes: 0

Related Questions