Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-08
2
Medium Priority
?
2,596 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
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.

618 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