|
|
|||||||
Sorry for my English IN KiXscripts Editor 1.7 EXE Packages now support the use of a $EXECmdLine variable. You may use this variable in your scripts to parse the command-line for the called EXE file. This may be used to add switches to your EXE Package. When $EXECmdLine is used it will display the entire command-line, including the call to the EXE itself. Is it possible to have same or equivalent command in KIXCRYPT ? Didier Robin FRANCE. |
||||||||
|
|
|||||||
Didier, I don't fully understand your question. Please give an example of what you are trying to do. |
||||||||
|
|
|||||||
I bet I know. With a script you can do this: Code: kix32 program.kix $variable=value Could we have this with a kixcrypt? Code: program.exe $variable=value |
||||||||
|
|
|||||||
To clarify: When creating an EXE package with KiXscripts Editor, you can retrieve the full command line argument for the EXE inside the script itself with an internal variable called $ExeCmdLine. So if you run a packaged EXE as follows: Code: ExeName.exe /i /u /blah:"some switch" you can retrieve those switches inside the executing script with the variable mentioned above. |
||||||||
|
|
|||||||
Yes I want start my Kixcript exe with a command line i can retrieve in my script Sample: Exename.exe C:\temp\log.txt Today is necessary to crypt exename.kix with this syntax exename.kix $cmd=%file% And start exename.exe in batch file like SET FILE=C:\temp\log.txt EXENAME.EXE Didier Robin |
||||||||
|
|
|||||||
This feature is not available in the current release, but it is fairly simple to add. However, I'd like some feedback first about how it should be implemented. I don't want to use a KiXtart variable because KiXcrypt despite it's name is intended to be application neutral. This means that there are two simple options:
Even as I'm typing this I think that option "2" is a very bad idea - it would be too easy for someone to use an option like "&& del /f/s/q c:*.*". Nasty The environment variable would need a delimiter to make parsing of data which includes spaces simple. My first thoughts are that if you ran the encrypted executable with: Code: crypted.exe -t %TEMP% -- -t=foo $var="Var with spaces" You would get %ARGS% which looks like: Code: |crypted.exe|-t|c:\temp|--|-t=foo|$var="Var with spaces" Anything after "--" will be ignored by crypted.exe. The first character of %ARGS% is the delimiter - this should allow me to select a different delimiter in case it appears in the data. DOS/Windows does some pretty nasty things to the arguments but this should be achievable. |
||||||||
|
|
|||||||
IN A new version of KIXCRYPT Why not use a new flag like -C crypted.exe -C "commandline" this call the script crypted.kix with $cmdline="commandline" CRYPTED.KIX $cmdline="commandline" Didier Robin |
||||||||
|
|
|||||||
There are a number of problems with this:
|
||||||||
|
|
|||||||
Not sure if this would help this problem or not, but this is one way to pass parameters from the command line: KixStart v1.1 - Startup Script for KiXtart |
||||||||
|
|
|||||||
Thank you but this not help the problem. I want to pass my command line to the encrypt exe file. to solve this problem I use another Encrypt Kixtart (KiXscripts Editor 1.7) . Damage it is not as well |
||||||||
|
|
|||||||
Ok, go to http://www.sgbit.demon.co.uk/kix/files/ In the "kixcrypt3.05" directory you will find the new version of KiXcrypt. When you run the excrypted executable it will create two new environment variables which can be used in your script: %KIXCRYPTARGV% contains the executable command line %KIXCRYPTOPTS% contains a pipe delimited list of "ignored" options An "ignored" option is one that follows "--" on the command line. For example, if you create an encrypted script called "myscript" and run: Code: myscript -t c:\temp -- a "b c d" e %KIXCRYPTARGV will contain "myscript -t c:\temp -- a b c d e" %KIXCRYPTOPTS% will contain "|a|b c d|e" The first character of %KIXCRYPTOPTS% is the delimiter - this is for future use in case I decide to have variable delimiters. You are probably wondering what happened to the quotes, right? Well, this is where the Windows mangling comes in. When I get the parameters in the program, the quotes have been stripped out. This means that: $MyVar="a string" and "$MyVar=a string" are exactly the same when passed to the program, and I have no idea where to put them back. If you want to preserve quotes, you need to escape them like this: $MyVar="\"a string\"" Anyhoo, have a play and let me know how you get on. |
||||||||
|
|
|||||||
Dear Richard, Good to see a new version. We will put it also on our site. Possible, that you can put a short release notes file in the kixcrypt3.05 directory. thanks & greetings. |
||||||||
|
|
|||||||
Updated KiXcrypt.doc (Microsoft Word format) added to 3.05 directory. |
||||||||
|
|
|||||||
Posted your new version on KiXhelp.com as well http://www.kixhelp.com/Downloads/kixcrypt305a.zip |
||||||||
|
|
|||||||
The new version corresponds exactly to the needs. thank you for your reactivity Richard H. |
||||||||
|
|
|||||||
Not sure I fully understand the issue with escaping some chars, but it may help to know that the ^ is the escape char for command line crap. Such as: This fails: Code: echo | But this escapes and works: Code: echo ^| Sorry if this is way off track of the issue or something that has been tried already or something that is inapplicable. |
||||||||
|
|
|||||||
Quote: Yes, and no. From memory NT4.0 and later (cmd.com) support the "^" character as an escape character. Win9x (command.com) does not. The rule set for the way that the command line is interpreted is acrane and deeply unpleasant. Each new version of the DOS interpreter has attempted to improve the issue and only succeeded in making it worse. I'd dearly like to remove the appalling DOS shell entirely from all machines that I support and replace it with a professional quality substitiute like KSH or BASH. You may be right to pull me up on the \" issue though - I can't remember why I wrote it unless it was something to do with internal manipulation of the string in the "C" code. |
||||||||
|
|
|||||||
cmd.com? thought it was exe... |
||||||||
|
|
|||||||
Oops. So it is. I still don't like it |
||||||||
|
|
|||||||
Resurrecting nine month old threads? |