Jump to content

SEND KEYS to CMD


Ace08
 Share

Recommended Posts

Hi guys i am trying to decrypt a file thru winzip command line support add-on, the problem is my winzip current version(15.0) is only an evaluation version. with that, when i run the script cmd gives me this

WinZip® Command Line Support Add-On Version 3.2 (Build 8668)

Copyright © 1991-2009 WinZip International LLC - All Rights Reserved

THANK YOU FOR TRYING WINZIP COMMAND LINE ADD-ON

This is a fully functional version for EVALUATION USE ONLY

This notice is not displayed with registered Standard and Pro editions of

WinZip.

Please go to www.winzip.com to order WinZip.

<press any key to continue <Ctrl-C to quit>>

so i was thinking of just doing a send function but unfortunately this does not work, even tried doing a console write with no luck at all this wont work also. Here is the code i have so far.

$hFiles = "C:\TEST\InputFile\file.zip
$ZipLoc = chr(34) & "C:\Program Files\WinZip\WZUNZIP" & chr(34)
Run("cmd /k " & $ZipLoc & " -e -o -sPHd893iy " & $hFiles & " C:\TEST\ENC")
Send("{a}")

Any help would be appreciated.

EDIT: Removed unecessary codes

Edited by Ace08

Work smarter not harder.My First Posted Script: DataBase

Link to comment
Share on other sites

I suggest using either rar.exe or unrar.exe (command line versions of winrar, both free I believe) or piping the keystrokes into the command. Here is an example

#include <File.au3>
$String = 'Y' & @CRLF   ;keystrokes to save in file
$sTemp = _TempFile()    ;create random tempfile
FileWrite($sTemp, $String)  ;save keystrokes to random tempfile

$Directory  = @TempDir & '\' & Random(1, 5000) & 'Dir'  ;generate random name

DirCreate($Directory)   ;create a directory with generated name

_FileCreate($Directory & '\' & 'NewFile.txt')   ;create one file in the random directory

Run(@Comspec & ' /k del "' & $Directory & '" < "' & $sTemp & '"')   ;del generated directory piping contents of text file into the command
Link to comment
Share on other sites

Thanks Varian, i've also tried using winrar however the files i am receiving are encrypted to winzip with 128 AES compression method, when i tried it with winrar i am getting an error C:\TEST\InputFile\file.zip is not a valid archive.

with my original post is there no way to send keys with cmd with my problem?

i've tried a simple command code

Run(@COMSPEC & " /K Dir /p C:\")
sleep(2000)
send("{a}")
sleep(2000)
send("{a}")

here i can see that the srcipt sends keys at cmd

Work smarter not harder.My First Posted Script: DataBase

Link to comment
Share on other sites

Ok,

my cmd knowlegde get a little bit rusty, but in former time I used a "pipe in" sign which worked in some cases and also for your example:

Run(@COMSPEC & " /K Dir /p C:\ <c:\test.tmp")

Where the file test.tmp has only "~" as content.

HTH, Reinhard

Link to comment
Share on other sites

Thanks a lot guys for the help but after pondering last night i have noticed one bad thing about my script, using winzip(it expires after 45 days :)) so the command line add on wont be useful when that time comes, then i decided to have a second look with what varian said on winrar and after setting up the commands and switches i finaly found the solution and the best thing was it can be executed as a code so there is no need for me to call cmd anymore ;)

@ReFran

uhm i dont think its with the piping issue because i was able to call winzip addon and since i am using winzip eval ver. i am getting those result at cmd and when i press any key it will decrypt the file

Edited by Ace08

Work smarter not harder.My First Posted Script: DataBase

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...