Sign in to follow this  
Followers 0
SWB

RunWait(@ComSpec or just RunWait

3 posts in this topic

#1 ·  Posted (edited)

I need to achive this:> C:File.rar with this line:> RunWait(@ComSpec & " /k " & "'C:Program FilesWinRARRar.exe a -av -m5 -o+ -r -sfx'" & '' & GUICtrlRead($Archive) & '' & GUICtrlRead($Name) & '' & '.rar')

I have tried every combination, and even moving the .rar to different locations in the line, and I'm pulling my hair out trying to figure this out.

The GUI part is working, it brings up the rar cmd window, but either sits there or gives an error: The filename, directory name, or volume label syntax is incorrect., depending on how things are changed.

Thanks,

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

;Global $Program = "C:Program FilesWinRAR"

Dim $msg, $fsf

Dim $guiHandle = GUICreate("RAR", 200, 135)

GUICtrlCreateLabel('Name of RAR:' , 5, 5, 190)

Dim $Name = GUICtrlCreateInput("", 5, 20, 165)

GUICtrlCreateLabel('Archive File:' , 5, 50, 190)

Dim $Archive = GUICtrlCreateInput("", 5, 65, 165)

Dim $Folder = GUICtrlCreateButton( '...', 170, 65, 25, 22)

Dim $rarbutton = GUICtrlCreateButton("Run RAR", 5, 108, 75)

Dim $exitbutton = GUICtrlCreateButton("Exit", 120, 108, 75)

GUISetState(@SW_SHOW, $guiHandle )

While 1

$msg = GUIGetMsg($guiHandle )

Select

Case $msg == $GUI_EVENT_CLOSE Or $msg = $exitbutton

Exit

Case $msg == $Folder

$fsf = FileSelectFolder('Choose Folder to Archive', '')

If Not @error Then GUICtrlSetData($Archive, $fsf)

Case $msg == $rarbutton

RunWait(@ComSpec & " /k " & "'C:Program FilesWinRARRar.exe a -av -m5 -o+ -r -sfx'" & '' & GUICtrlRead($Archive) & '' & GUICtrlRead($Name) & '' & '.rar')

Case Default

EndSelect

WEnd

Edited by SWB

Share this post


Link to post
Share on other sites



if this shows up twice then blame the forum software.

rar is just another of the multitude of archivers built on 7zip so why waste your time with it?

just use the 7zip command line version instead and you will find it much easier.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

if this shows up twice then blame the forum software.

rar is just another of the multitude of archivers built on 7zip so why waste your time with it?

just use the 7zip command line version instead and you will find it much easier.

I prefer WinRAR at this point in time btw copyright for WinRAR 1993, 7-Zip copyright 1999.

Thanks, though for the info.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0