Jump to content

ARC Backup + CMD problem show


Recommended Posts

Hi guys
I can't see the arc.exe cmd in edit1

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <SendMessage.au3>
#include <Constants.au3>

$FormName = "test arc"
$Form1 = GUICreate($FormName, 566, 401, -1, -1)
$Inp = GUICtrlCreateInput("", 8, 32, 465, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Out = GUICtrlCreateInput("", 8, 64, 465, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$BtnSelectFolder = GUICtrlCreateButton("Browse", 480, 30, 75, 25)
$BtnFileSaveDialog = GUICtrlCreateButton("Save", 480, 62, 75, 25)
$BtnCompress = GUICtrlCreateButton("Compress", 480, 128, 75, 25)
$Edit1 = GUICtrlCreateEdit("", 8, 176, 545, 200)
GUISetState(@SW_SHOW)

Local $ArcDir = '"' & @ScriptDir & '\Bin\arc.exe"'

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Exit
        Case $BtnSelectFolder
        Local $sFileSelectFolder = FileSelectFolder("", "")     
        GUICtrlSetData($Inp, $sFileSelectFolder)

        Case $BtnFileSaveDialog
        $sFileSaveDialog = FileSaveDialog("Save file", @WorkingDir, "Extension (*.arc)|Extension (*.Arc)", 2, "Setup-1")
        GUICtrlSetData($Out, $sFileSaveDialog)

        Case $BtnCompress
        If GUICtrlRead($Inp) = "" Then
        MsgBox(48, $FormName, "The boxes must not be empty!")
        ContinueLoop
        EndIf
        If GUICtrlRead($Out) = "" Then
        MsgBox(48, $FormName, "The boxes must not be empty!")
        ContinueLoop
        EndIf       
    _Seven_Zip()
    EndSwitch
WEnd

Func _Seven_Zip()   
    $pid = Run($ArcDir & ' a -ep1 -ed -r -w.\tmp -mx "' & GUICtrlRead($Out) & '" "' & GUICtrlRead($Inp) & '"',"",@SW_HIDE)

    GUICtrlSetData($edit1, $Out)    
    $Out = StdoutRead($pid)
    $Out = StderrRead($pid)
    StringInStr($Out,$edit1)
EndFunc

 

Edited by AlMax3000
Link to comment
Share on other sites

You need to wait for Run to end before reading the stream.  Look help file, it has examples about this.  Second you could do the ZIP thing within the Shell.Application object which would give you somewhat more control and you could implement on any Windows machine without outside application.  But I doubt you will like this suggestion :ermm:

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...