Solved

WinRAR (rar.exe)  how can I use shell commands in a ListFile (%USERPROFILE% for example)

Posted on 2004-09-08
2
2,585 Views
Last Modified: 2008-01-09
WinRAR (rar.exe)  how can I use shell commands in a ListFile (%USERPROFILE% for example)

Such as a listfile that contains

"%USERPROFILE%\My Documents\*.txt"
"%USERPROFILE%\Templates\*.txt"
0
Comment
Question by:sendtojp
2 Comments
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 12004814
If winrar doesn't support the use of environment variables in this file, your only possibility is to create the listfile "on the fly" in a batch.
The script below gives you an example; depending on what you want to do, this could be improved.

@echo off
setlocal
set ListFile=%Temp%\~ListFile.tmp

if exist "%ListFile%" del "%ListFile%"
:: *** Create the list file for winrar:
>>"%ListFile%" echo %UserProfile%\My Documents\*.txt
>>"%ListFile%" echo %UserProfile%\Templates\*.txt

:: *** call winrar:
rar.exe /<WhateverOptionWinRaRusesfortheListFile> "%ListFile%"
0
 
LVL 1

Author Comment

by:sendtojp
ID: 12042092
VERY GOOD ANSWER.  I have decovered RAR does not support shell commands, parhaps because of the enviromental reasons you gave.  For another 500pts how can you use RAR and shell commands in Visual Basic 6/NET.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now