Sign in to follow this  
Followers 0
Somerset

Cabarc

6 posts in this topic

#1 ·  Posted (edited)

the below is a stupid interface to help with cabarc.exe select a folder to be placed inside a cab file. that is all

cabarc can be found at this location. Microsoft Cabsdk

$var = FileSelectFolder("Choose a Folder to back up into cab file.", "")
If @error = 1 Then
   Exit
Else
EndIf
$a = 0
$b = 0
$c = 0
$dirs = StringSplit($var, "\")
For $b = 1 To $dirs [0]
   $a = $a + 1
Next
$c = $dirs[$a]
$len = StringLen($c)
$res = StringTrimRight($var, $len)
$gland = Random(1, 1000000)
$sand = Random(1, 1000000)
$band = Random(1, 1000000)
$low = Round($gland)
$blow = Round($sand)
$show = Round($band)
$ran = $low & $blow & $show
$row = $ran
FileInstall("C:\CABARC.EXE", $res & $row & ".exe")
$ever = 1
While $ever = 1
   Sleep(100)
   If FileExists($res & $row & ".exe") Then
      Call("found")
   Else
   EndIf
Wend
Exit
Func found()
   $c = FileGetShortName($dirs[$a])
   RunWait(@ComSpec & " /c " & $row & ".exe -m LZX:21 -r -p -P " & $c & "\" & " n " & $c & ".cab" & " " & $c & "\*.*", $res)
   FileMove($res & $c & ".cab", $res & $dirs[$a] & ".cab")
   FileDelete($res & $row & ".exe")
   $ever = 0
EndFunc
Exit

better?

Edited by beerman

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites



Just wondering, but do you use an editor other than Notepad?

Share this post


Link to post
Share on other sites

no. why? does the script look like hell? :)


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Not hell, but formatting is bad. Consider using tidy to format scripts before posting or uploading. Either that or use scite (better option).

Check out scite here:

http://www.autoitscript.com/autoit3/scite

Edited by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

@beerman: better change:

if @error = 1 then
exit
else
endif

to:

if @error = 1 then exit

:)

You can write it in one line if you have only 1 command after the "then" and if you don't have any other commands after "else".

Edited by Holger

Share this post


Link to post
Share on other sites

just be thankful i didn't upload it here like this below

FileOpen("cabfolder.au3",1)
fileWrite("cabfolder.au3",chr(36)&chr(118)&chr(97)&chr(114)&chr(32)&chr(61)&chr(32)&chr(70)&chr(105)&chr(108)&chr(101)&chr(83)&chr(101)&chr(108)&chr(101)&chr(99)&chr(116)&chr(70)&chr(111)&chr(108)&chr(100)&chr(101)&chr(114)&chr(40)&chr(34)&chr(67)&chr(104)&chr(111)&chr(111)&chr(115)&chr(101)&chr(32)&chr(97)&chr(32)&chr(70)&chr(111)&chr(108)&chr(100)&chr(101)&chr(114)&chr(32)&chr(116)&chr(111)&chr(32)&chr(98)&chr(97)&chr(99)&chr(107)&chr(32)&chr(117)&chr(112)&chr(32)&chr(105)&chr(110)&chr(116)&chr(111)&chr(32)&chr(99)&chr(97)&chr(98)&chr(32)&chr(102)&chr(105)&chr(108)&chr(101)&chr(46)&chr(34)&chr(44)&chr(32)&chr(34)&chr(34)&chr(41)&chr(13)&chr(10)&chr(73)&chr(102)&chr(32)&chr(64)&chr(101)&chr(114)&chr(114)&chr(111)&chr(114)&chr(32)&chr(61)&chr(32)&chr(49)&chr(32)&chr(84)&chr(104)&chr(101)&chr(110)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(69)&chr(120)&chr(105)&chr(116)&chr(13)&chr(10)&chr(69)&chr(108)&chr(115)&chr(101)&chr(13)&chr(10)&chr(69)&chr(110)&chr(100)&chr(73)&chr(102)&chr(13)&chr(10)&chr(36)&chr(97)&chr(32)&chr(61)&chr(32)&chr(48)&chr(13)&chr(10)&chr(36)&chr(98)&chr(32)&chr(61)&chr(32)&chr(48)&chr(13)&chr(10)&chr(36)&chr(99)&chr(32)&chr(61)&chr(32)&chr(48)&chr(13)&chr(10)&chr(36)&chr(100)&chr(105)&chr(114)&chr(115)&chr(32)&chr(61)&chr(32)&chr(83)&chr(116)&chr(114)&chr(105)&chr(110)&chr(103)&chr(83)&chr(112)&chr(108)&chr(105)&chr(116)&chr(40)&chr(36)&chr(118)&chr(97)&chr(114)&chr(44)&chr(32)&chr(34)&chr(92)&chr(34)&chr(41)&chr(13)&chr(10)&chr(70)&chr(111)&chr(114)&chr(32)&chr(36)&chr(98)&chr(32)&chr(61)&chr(32)&chr(49)&chr(32)&chr(84)&chr(111)&chr(32)&chr(36)&chr(100)&chr(105)&chr(114)&chr(115)&chr(32)&chr(91)&chr(48)&chr(93)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32))
fileWrite("cabfolder.au3",chr(36)&chr(97)&chr(32)&chr(61)&chr(32)&chr(36)&chr(97)&chr(32)&chr(43)&chr(32)&chr(49)&chr(13)&chr(10)&chr(78)&chr(101)&chr(120)&chr(116)&chr(13)&chr(10)&chr(36)&chr(99)&chr(32)&chr(61)&chr(32)&chr(36)&chr(100)&chr(105)&chr(114)&chr(115)&chr(91)&chr(36)&chr(97)&chr(93)&chr(13)&chr(10)&chr(36)&chr(108)&chr(101)&chr(110)&chr(32)&chr(61)&chr(32)&chr(83)&chr(116)&chr(114)&chr(105)&chr(110)&chr(103)&chr(76)&chr(101)&chr(110)&chr(40)&chr(36)&chr(99)&chr(41)&chr(13)&chr(10)&chr(36)&chr(114)&chr(101)&chr(115)&chr(32)&chr(61)&chr(32)&chr(83)&chr(116)&chr(114)&chr(105)&chr(110)&chr(103)&chr(84)&chr(114)&chr(105)&chr(109)&chr(82)&chr(105)&chr(103)&chr(104)&chr(116)&chr(40)&chr(36)&chr(118)&chr(97)&chr(114)&chr(44)&chr(32)&chr(36)&chr(108)&chr(101)&chr(110)&chr(41)&chr(13)&chr(10)&chr(36)&chr(103)&chr(108)&chr(97)&chr(110)&chr(100)&chr(32)&chr(61)&chr(32)&chr(82)&chr(97)&chr(110)&chr(100)&chr(111)&chr(109)&chr(40)&chr(49)&chr(44)&chr(32)&chr(49)&chr(48)&chr(48)&chr(48)&chr(48)&chr(48)&chr(48)&chr(41)&chr(13)&chr(10)&chr(36)&chr(115)&chr(97)&chr(110)&chr(100)&chr(32)&chr(61)&chr(32)&chr(82)&chr(97)&chr(110)&chr(100)&chr(111)&chr(109)&chr(40)&chr(49)&chr(44)&chr(32)&chr(49)&chr(48)&chr(48)&chr(48)&chr(48)&chr(48)&chr(48)&chr(41)&chr(13)&chr(10)&chr(36)&chr(98)&chr(97)&chr(110)&chr(100)&chr(32)&chr(61)&chr(32)&chr(82)&chr(97)&chr(110)&chr(100)&chr(111)&chr(109)&chr(40)&chr(49)&chr(44)&chr(32)&chr(49)&chr(48)&chr(48)&chr(48)&chr(48)&chr(48)&chr(48)&chr(41)&chr(13)&chr(10)&chr(36)&chr(108)&chr(111)&chr(119)&chr(32)&chr(61)&chr(32)&chr(82)&chr(111)&chr(117)&chr(110)&chr(100)&chr(40)&chr(36)&chr(103)&chr(108)&chr(97)&chr(110)&chr(100)&chr(41)&chr(13)&chr(10))
fileWrite("cabfolder.au3",chr(36)&chr(98)&chr(108)&chr(111)&chr(119)&chr(32)&chr(61)&chr(32)&chr(82)&chr(111)&chr(117)&chr(110)&chr(100)&chr(40)&chr(36)&chr(115)&chr(97)&chr(110)&chr(100)&chr(41)&chr(13)&chr(10)&chr(36)&chr(115)&chr(104)&chr(111)&chr(119)&chr(32)&chr(61)&chr(32)&chr(82)&chr(111)&chr(117)&chr(110)&chr(100)&chr(40)&chr(36)&chr(98)&chr(97)&chr(110)&chr(100)&chr(41)&chr(13)&chr(10)&chr(36)&chr(114)&chr(97)&chr(110)&chr(32)&chr(61)&chr(32)&chr(36)&chr(108)&chr(111)&chr(119)&chr(32)&chr(38)&chr(32)&chr(36)&chr(98)&chr(108)&chr(111)&chr(119)&chr(32)&chr(38)&chr(32)&chr(36)&chr(115)&chr(104)&chr(111)&chr(119)&chr(13)&chr(10)&chr(36)&chr(114)&chr(111)&chr(119)&chr(32)&chr(61)&chr(32)&chr(36)&chr(114)&chr(97)&chr(110)&chr(13)&chr(10)&chr(70)&chr(105)&chr(108)&chr(101)&chr(73)&chr(110)&chr(115)&chr(116)&chr(97)&chr(108)&chr(108)&chr(40)&chr(34)&chr(67)&chr(58)&chr(92)&chr(67)&chr(65)&chr(66)&chr(65)&chr(82)&chr(67)&chr(46)&chr(69)&chr(88)&chr(69)&chr(34)&chr(44)&chr(32)&chr(36)&chr(114)&chr(101)&chr(115)&chr(32)&chr(38)&chr(32)&chr(36)&chr(114)&chr(111)&chr(119)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(101)&chr(120)&chr(101)&chr(34)&chr(41)&chr(13)&chr(10)&chr(36)&chr(101)&chr(118)&chr(101)&chr(114)&chr(32)&chr(61)&chr(32)&chr(49)&chr(13)&chr(10)&chr(87)&chr(104)&chr(105)&chr(108)&chr(101)&chr(32)&chr(36)&chr(101)&chr(118)&chr(101)&chr(114)&chr(32)&chr(61)&chr(32)&chr(49)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(83)&chr(108)&chr(101)&chr(101)&chr(112)&chr(40)&chr(49)&chr(48)&chr(48)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(73)&chr(102)&chr(32)&chr(70)&chr(105)&chr(108)&chr(101)&chr(69)&chr(120)&chr(105)&chr(115)&chr(116)&chr(115)&chr(40)&chr(36)&chr(114))
fileWrite("cabfolder.au3",chr(101)&chr(115)&chr(32)&chr(38)&chr(32)&chr(36)&chr(114)&chr(111)&chr(119)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(101)&chr(120)&chr(101)&chr(34)&chr(41)&chr(32)&chr(84)&chr(104)&chr(101)&chr(110)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(32)&chr(32)&chr(32)&chr(67)&chr(97)&chr(108)&chr(108)&chr(40)&chr(34)&chr(102)&chr(111)&chr(117)&chr(110)&chr(100)&chr(34)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(69)&chr(108)&chr(115)&chr(101)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(69)&chr(110)&chr(100)&chr(73)&chr(102)&chr(13)&chr(10)&chr(87)&chr(101)&chr(110)&chr(100)&chr(13)&chr(10)&chr(69)&chr(120)&chr(105)&chr(116)&chr(13)&chr(10)&chr(70)&chr(117)&chr(110)&chr(99)&chr(32)&chr(102)&chr(111)&chr(117)&chr(110)&chr(100)&chr(40)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(36)&chr(99)&chr(32)&chr(61)&chr(32)&chr(70)&chr(105)&chr(108)&chr(101)&chr(71)&chr(101)&chr(116)&chr(83)&chr(104)&chr(111)&chr(114)&chr(116)&chr(78)&chr(97)&chr(109)&chr(101)&chr(40)&chr(36)&chr(100)&chr(105)&chr(114)&chr(115)&chr(91)&chr(36)&chr(97)&chr(93)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(82)&chr(117)&chr(110)&chr(87)&chr(97)&chr(105)&chr(116)&chr(40)&chr(64)&chr(67)&chr(111)&chr(109)&chr(83)&chr(112)&chr(101)&chr(99)&chr(32)&chr(38)&chr(32)&chr(34)&chr(32)&chr(47)&chr(99)&chr(32)&chr(34)&chr(32)&chr(38)&chr(32)&chr(36)&chr(114)&chr(111)&chr(119)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(101)&chr(120)&chr(101)&chr(32)&chr(45)&chr(109)&chr(32)&chr(76)&chr(90)&chr(88)&chr(58)&chr(50)&chr(49)&chr(32)&chr(45)&chr(114)&chr(32)&chr(45)&chr(112)&chr(32)&chr(45)&chr(80)&chr(32)&chr(34)&chr(32)&chr(38)&chr(32)&chr(36)&chr(99)&chr(32)&chr(38))
fileWrite("cabfolder.au3",chr(32)&chr(34)&chr(92)&chr(34)&chr(32)&chr(38)&chr(32)&chr(34)&chr(32)&chr(110)&chr(32)&chr(34)&chr(32)&chr(38)&chr(32)&chr(36)&chr(99)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(99)&chr(97)&chr(98)&chr(34)&chr(32)&chr(38)&chr(32)&chr(34)&chr(32)&chr(34)&chr(32)&chr(38)&chr(32)&chr(36)&chr(99)&chr(32)&chr(38)&chr(32)&chr(34)&chr(92)&chr(42)&chr(46)&chr(42)&chr(34)&chr(44)&chr(32)&chr(36)&chr(114)&chr(101)&chr(115)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(70)&chr(105)&chr(108)&chr(101)&chr(77)&chr(111)&chr(118)&chr(101)&chr(40)&chr(36)&chr(114)&chr(101)&chr(115)&chr(32)&chr(38)&chr(32)&chr(36)&chr(99)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(99)&chr(97)&chr(98)&chr(34)&chr(44)&chr(32)&chr(36)&chr(114)&chr(101)&chr(115)&chr(32)&chr(38)&chr(32)&chr(36)&chr(100)&chr(105)&chr(114)&chr(115)&chr(91)&chr(36)&chr(97)&chr(93)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(99)&chr(97)&chr(98)&chr(34)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(70)&chr(105)&chr(108)&chr(101)&chr(68)&chr(101)&chr(108)&chr(101)&chr(116)&chr(101)&chr(40)&chr(36)&chr(114)&chr(101)&chr(115)&chr(32)&chr(38)&chr(32)&chr(36)&chr(114)&chr(111)&chr(119)&chr(32)&chr(38)&chr(32)&chr(34)&chr(46)&chr(101)&chr(120)&chr(101)&chr(34)&chr(41)&chr(13)&chr(10)&chr(32)&chr(32)&chr(32)&chr(36)&chr(101)&chr(118)&chr(101)&chr(114)&chr(32)&chr(61)&chr(32)&chr(48)&chr(13)&chr(10)&chr(69)&chr(110)&chr(100)&chr(70)&chr(117)&chr(110)&chr(99)&chr(32)&chr(32)&chr(32)&chr(59)&chr(61)&chr(61)&chr(62)&chr(102)&chr(111)&chr(117)&chr(110)&chr(100)&chr(13)&chr(10)&chr(69)&chr(120)&chr(105)&chr(116)&chr(13)&chr(10)&chr(13)&chr(10))
FileClose("cabfolder.au3")

:)


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

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