#16787 - 2002-01-29 09:25 AM
Shell Command
|
t_pickering
Fresh Scripter
Registered: 2001-11-23
Posts: 26
|
Hi,I execute an exe file using the code below:- code:
shell "%comspec% /c pgp.exe"
The exe file displays a load of text. Is there a way of hiding this text? cmd.exe has a /q switch, which is supposed to turn echo off. This doesn't seem to work. Does anyone have any ideas?
|
|
Top
|
|
|
|
#16788 - 2002-01-29 01:59 PM
Re: Shell Command
|
Corky
Fresh Scripter
Registered: 2002-01-11
Posts: 13
|
Did you try piping the result to null?? Don't know if this will work but woth a try! shell "%comspec% /c pgp.exe > null"
Good Hunting! 
|
|
Top
|
|
|
|
#16790 - 2002-01-31 07:23 AM
Re: Shell Command
|
t_pickering
Fresh Scripter
Registered: 2001-11-23
Posts: 26
|
Hi guys,Nice ideas, but they didn't work. Does anyone else have an suggestions. Tim.  [ 31 January 2002: Message edited by: t_pickering ]
|
|
Top
|
|
|
|
#16793 - 2002-01-31 04:19 PM
Re: Shell Command
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
t_pickering,Doing a search from http://vivisimo.com gives us.. Found it!! http://www.openpgp.net/readme.asc quote:
-q Quiet mode
There appears to be several other too - DOC is right about the hundreds of switches!!: quote:
pgp s (Sign Functions): - -----------------------pgp s [-u userid] [-bafqtvz] [-o file2 [-o ]]PGP Sign file(s) -a ASCII armoring -b Detached signature -f Filter Mode; Read from stdin to stdout -o http://www.uk.pgp.net/pgpnet/pgp-faq/faq.html#4.7 http://www.tik.ee.ethz.ch/pgpnet/pgp-faq/pgpfaq.txt quote: 11.1 Are there undocumented features in PGP? Several undocumented command-line switches exist. Peter Simons has provided a comprehensive list: * The "-i" option will cause PGP to include more information about the file in the encrypted message. With the "-p" option, PGP restores the original filename when you decrypt the message, but if this option is also used, and both sender and recipient are using the same platform, then the original file permissions and timestamp will also be restored. * With the "-l" option PGP gives lots more information about what it is doing. During key generation, for example, you get to see the actual numbers used in your public and secret key. * The "-km" option will display the "web of trust" (see question 4.7) in a nested list. This way you can see which key introduces which. * By putting "encrypttoself=on" in your configuration file, all messages that you encrypt will always be encrypted with your own public key as well. This way you will be able to decrypt and read every message you send. This can be useful if you have PGP set up to encrypt every outgoing message, and your "outbox" will keep the encrypted versions. Note: if someone else ever manages to obtain your secret key, he will be able to read every encrypted message you ever sent out, if this option was enabled. * To create a file containing n random bytes, use the "pgp filename +makerandom=n". There is a bug in the international versions of PGP, which results in this random data being a lot less random than normal.
HTH,- Kent
|
|
Top
|
|
|
|
#16795 - 2002-02-05 08:25 AM
Re: Shell Command
|
t_pickering
Fresh Scripter
Registered: 2001-11-23
Posts: 26
|
Hi Guys,Yes I am trying to use pgp command line. The script below adds new keys to a users public key ring (pkr) code:
$pgp_prefs = "%userprofile%\application data\network associates\pgp\pgpprefs.txt" IF OPEN(2,$pgp_prefs) <> 0 COLOR r+/b ? " - Error opening PGPprefs.txt" COLOR w+/b RETURN ENDIF DO $x = READLINE(2) UNTIL INSTR($x, "UserAccountStatus") OR @ERROR = -1 SELECT CASE $x = "UserAccountStatus=0" ? " - PGP is running for the first time. The key generation wizard will display." CLOSE(2) RETURN CASE $x = "UserAccountStatus=1" ? " - PGP is installed but the current user is not configured to use it." CLOSE(2) RETURN CASE $x = "UserAccountStatus=2" ;? " - PGP is installed and the current user is configured to use it" ? " - Updating PGP public keyring ... " $pgp_exe = FindProfileSectionData($pgp, "pgp_exe") IF $error = 1 RETURN ENDIF $pgp_keys = FindProfileSectionData($pgp, "pgp_keys") IF $error = 1 RETURN ENDIF DO $x = READLINE(2) UNTIL INSTR($x, "PublicKeyringFile") OR @ERROR = -1 $pos = INSTR($x, CHR(61)) + 1 $len = LEN($x) $pkr_len = $len - $pos + 1 $pgp_pkr = substr ($x, $pos, $pkr_len) ? shell "%comspec% /c" + $pgp_exe + " -ka +batchmode +pubring=" + $pgp_pkr + " " + $pgp_keys IF @ERROR = 0 ? "Update completed" ELSE COLOR r+/b ? " - Error updating PGP public keyring" COLOR w+/b ENDIF ENDSELECT CLOSE(2)
The script works great. The only problem is that it displays a load of text when pgp.exe runs. FYI :- FindProfileSectionData is a udf i've written. It reads in entries from a config file. The -q doesn't seem to work, piping it also doesn't work. Any ideas? Tim. [ 05 February 2002: Message edited by: t_pickering ] [ 05 February 2002: Message edited by: t_pickering ]
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1821 anonymous users online.
|
|
|