Solved

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

Posted on 2004-09-08
2
2,593 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Often we come across situations wherein our batch files would be needing to reboot Windows for a variety of reasons. A few of them would be like: (1) Setup files have been updated whose changes can take effect only after a reboot …
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

707 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