Link to home
Start Free TrialLog in
Avatar of ahmed_bq
ahmed_bqFlag for Egypt

asked on

RAR inside VBscript code

The code below is rename folder to today's name
I need also to compress the result file in to folder name "_archive"  as:  
E:\Inventory Files\inventory\_archive\20081028.rar

how can I make this?
please help
strMonth = Month(Date)
If Len(strMonth) = 1 Then
strMonth = "0" & strMonth
End If
strDay = Day(Date)
If Len(strDay) = 1 Then
strDay = "0" & strDay
End If
strYear = Year(Date)
StrHour=Hour(Time)
StrDate = StrYear & StrMonth & StrDay
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFolder "E:\Inventory Files\inventory" , "E:\Inventory Files\" & StrDate

Open in new window

Avatar of Jared Luker
Jared Luker
Flag of United States of America image

The easiest thing to do would just use the command line RAR utility with the Run command in vbscript.

The file is located in c:\program files\winrar\rar.exe

The syntax can be found here:

http://www.rarreg.com/users_manual.php
Avatar of ahmed_bq

ASKER

thanks jared_luker:

but I ned to insert rar command in vbscript using my variables as my quistion above!
You can use your variables within the run command
ASKER CERTIFIED SOLUTION
Avatar of Jared Luker
Jared Luker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial