Solved

RAR inside VBscript code

Posted on 2008-10-28
4
2,139 Views
Last Modified: 2012-05-05
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

0
Comment
Question by:ahmed_bq
  • 3
4 Comments
 
LVL 17

Expert Comment

by:Jared Luker
ID: 22822323
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
0
 

Author Comment

by:ahmed_bq
ID: 22822507
thanks jared_luker:

but I ned to insert rar command in vbscript using my variables as my quistion above!
0
 
LVL 17

Expert Comment

by:Jared Luker
ID: 22822545
You can use your variables within the run command
0
 
LVL 17

Accepted Solution

by:
Jared Luker earned 125 total points
ID: 22822557
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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