Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Restoring files with VSS not possible Path too long 2 121
SCCM And Branchcache Server 1 65
WORM compliant device  what is it? 12 112
Chrome VM 1 31
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…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
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.

739 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