Solved

RAR inside VBscript code

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now