Solved

RAR inside VBscript code

Posted on 2008-10-28
4
2,119 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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