Jump to content

WinRAR command line help


jamesbebby

Recommended Posts

Hi, i do a weekly backup of my anti virus updates with a simple .cmd file on my desktop with save them on my USB drive

ROBOCOPY "%ALLUSERSPROFILE%\Microsoft\Microsoft Antimalware\Definition Updates\Backup" "Z:\Windows 7\$oem$\$$\Install\FirstLogOn\Anti-Virus Updates\Microsoft Security" /E /IS

Which works fine, Now i would like it if winrar would make a .sfx within this .cmd reading about and i know it can be done.

Heres how far ive got

"C:\Program Files\WinRAR\rar.exe" a -m5 -sfx "Z:\Windows 7\$oem$\$$\Install\FirstLogOn\Anti-Virus Updates\Microsoft Security\Backup.rar" "Z:\Windows 7\$oem$\$$\Install\FirstLogOn\Anti-Virus Updates\Microsoft Security"

This is making the .sfx fine but the only thing is that its adding the whole path with-in the sfx, i just want the files and no path

winrar_problem.jpg

Note the info.txt will have the .sfx comment that ill be trying to add after this problem

If you know what ive done wrong please advise.

Thanks, James

Edited by jamesbebby
Link to comment
Share on other sites


Which version of WinRAR are you using?

I believe that 'Extract relative paths' is now the default extraction mode in version 4.00, if you are using a previous version you may need to look at the -ep switch.

Link to comment
Share on other sites

Top man!!! The -ep switch worked.

Cheers, James

EDIT> that -ep switch is working great for the 'Microsoft Security' updates because there all files.

But with 'Malwarebytes' Anti-Malware' theres a folder with 2 log files in, so when i run -ep the 2 log file are just being put with the rest of the files and no log folder is being added?....

Malwarebytes' Anti-Malware folder layout

logs [folder]>protection-log-2011-04-03.txt & protection-log-2011-04-04.txt

config.dat

ignore.dat

local.dat

rules.ref

info.txt

link.txt

news.txt

When its been archive in the sfx

protection-log-2011-04-03.txt

protection-log-2011-04-04.txt

config.dat

ignore.dat

local.dat

rules.ref

info.txt

link.txt

news.txt

No log folder included.

The log files in 'Malwarebytes' Anti-Malware' are useless but when i start doing/making other command line sfx its guna be.

Thanks James

Edited by jamesbebby
Link to comment
Share on other sites

All sorted now, All thats was missing was -ep1 and a simple \backslash\ that points winrar to the folder

"Z:\Windows 7\$oem$\$$\Install\FirstLogOn\Anti-Virus Updates\Microsoft Security" WRONG

"Z:\Windows 7\$oem$\$$\Install\FirstLogOn\Anti-Virus Updates\Microsoft Security\" RIGHT

Winrar & .cmd your so powerful together, it wicked! Put it this way with 1 click of a .cmd file im backing up and making a sfx that point back to all the right directorys of 'firefox user profile', 'microsoft security essentials', 'Malwarebytes' Anti-Malware' & 'filemenu tools' so on a fresh install everything is going to be like it was!!!

Cheers, James

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...