Solved

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

Posted on 2004-09-08
2
2,589 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 84

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
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.

856 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