Page 1 of 1 1
Topic Options
#16787 - 2002-01-29 09:25 AM Shell Command
t_pickering Offline
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 Offline
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
#16789 - 2002-01-30 07:22 AM Re: Shell Command
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Try also something like:

SHELL '%comspec% /c start /minimized pgp.exe '

verify start options for your windows version.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#16790 - 2002-01-31 07:23 AM Re: Shell Command
t_pickering Offline
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
#16791 - 2002-01-31 08:42 AM Re: Shell Command
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Corky,

Sorry about this, but *** CAUTION ***

With the syntax you provided, you will create a file called null in the same directory you execute this in. Otherwise, users may get errors when excuting commands.

Try this instead...

code:

shell "%comspec% /c pgp.exe > nul"

If that does not work, try looking at the Help for this program i.e. PGP.EXE /?. Usually programs like Windows Installers and such have hidden switches to suppress them like 290700usam.exe -s.

HTH,

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#16792 - 2002-01-31 09:16 AM Re: Shell Command
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
t_pickering

Unless this is a custom application. I would assume your talking about a command line utility called (Pretty Good Privacy, PGP) which has little to no value without being called with a lot of switches. This program is used to encrypt data. Its a great program but not too user friendly.

Is this the program you're talking about?
http://www.pgp.com/products/default.asp

Top
#16793 - 2002-01-31 04:19 PM Re: Shell Command
Kdyer Offline
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 Output file for most recent input file
-q Quiet mode
-t Text mode
-u UserID of the key you wish to sign with. May only be
specified once. If not specified, your default signing
key will be used.
-v Verbose
-z Batch mode (assumes no user interaction; not yet
implemented.)
-h Display this screen

--license Display usage license

pgp e (Encrypt Functions):
- --------------------------

pgp e [[-r -r ] [-s [-u ]] | [-c]] [-afqtvz]
[-o outfile1] [-o ]

PGP Encrypt file(s)

-a ASCII armoring
-c Conventional Encryption (IDEA only; is mutually exclusive
with -s, -u and -r)
-f Filter Mode; Read from stdin to stdout
-o Output file for most recent input file
-q Quiet mode
-r UserID to encrypt to. May be specified multiple times.
-s Sign, as well as encrypt (use pgps to just sign). If no
userid is specified with -u, the default userid is used.
-t Text mode
-u UserID of the key you wish to sign with. May only be
specified once.
-v Verbose
-z Batch mode (assumes no user interaction; not yet
implemented.)
-h Display this screen

--license Display usage license

pgp v (Decrypt/Verify Functions):
- ---------------------------------

pgp v [-dfKmqvz] [-o file2 -o ]

Decrypt/Verify PGP encrypted and/or signed file(s)

-f Filter Mode; Read from stdin to stdout
-K Do not process any keys that are present (normally pgpv
will add keys to your keyring if found in an input file)
-m More Mode; display using pager rather than saving
-o Output file for most recent input file
-q Quiet mode
-v Verbose
-z Batch mode (assumes no user interaction; not yet
implemented).

-h Display this screen

--license Display usage license

pgpk (Key Management functions):
- --------------------------------
To generate your own unique public/private key pair:
pgpk -g [ DSS|RSA ]

To add a key file's contents to your public or private key ring:
pgpk -a keyfile [keyfile ...]

To remove a key from your public and private key ring:
pgpk -r userid (or pgpk -rk userid)

To remove a user ID from your public and private key ring:
pgpk -ru userid

To remove a signature from your public key ring:
pgpk -rs userid

To edit your user ID or pass phrase:
pgpk -e your_userid

To edit the confidence you have in a person as an introducer:
pgpk -e her_userid

To extract (copy) a key from your public key ring:
pgpk -x userid -o keyfile

To extract (copy) a key from your public key ring in ascii form:
pgpk -xa userid -o keyfile

To list the contents of your key rings:
pgpk -l[l] [userid]

To check signatures on your public key ring:
pgpk -c [userid]

To sign someone else's public key on your public key ring:
pgpk -s her_userid [-u your_userid]

To disable or re-enable some else's public key on your public key ring:
pgpk -d her_userid

To permanently revoke your own key on your public and private key rings:
pgpk --revoke your_userid

To revoke a signature you made on someone else's key on your pub key ring:
pgpk --revokes your_userid

To view the license granted you:
pgpk --license



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

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#16794 - 2002-02-01 11:41 AM Re: Shell Command
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
I know there are a lot of switches. I've been using the program for a few years now.

Here is a sample of the output:

ORIGINAL

code:
Hello everyone... This is a test message for 
my friends at KiXtart.org

PGP ENCRYPTED CODE OF ABOVE TEXT

code:
-----BEGIN PGP MESSAGE-----
Version: PGP 7.1

qANQR1DBwU4DmGDQfhRRLT8QB/4+fKnpobi72cfQFyblz8ovLBZtZW1ryIblm+QL
zTPQLksjzgR54LBYVG5NT3G63HN7NQdBjnCePTo/5K0XjSxubor976BYM/4xmoFg
PG3wn037cQ6OlfcnTFrgbG5rrTmJXQTt4VcVSaJmtZCM4/qDGc7+O1AFaltyj5zU
hJP/ZJ664mbxfJakd3wUAQKU0QlBa1j8ftiF4b2eXw8bjyfiBTpB1L9iVxgudDC7
I846No4txXnirE6Z6EDSk6TVAmWo7i2aF9oQS5l5pvAKlHC1Jr6QNONm0KM6YHJs
mFPRm9lbq3EKB+27jBQk9hFc9JMP3yNg0rg7GJlwXoTIw47YCADAc79f9X37ngNM
4MSTxfa5zB9m1+mSgepqh4rrePD2ztwzksoxT5pwrh8GRqwlPkphjsoR60jEEo8Z
Syual7+RwQEwwrV5QIiRy/mUjzTOLMEACVnUZit5ARUkVDg4kOyRJPH0Muu3hnjq
mE4jckMuM2qM8jRBMGRfdrLWPWVCIjWV3fexFds48ZoDksXjMHL7mEaHM5Sa6uMF
2tUuTS3MJI3GbZ8Fkb373uGU5SpTRsY+6ZJX34ydto67UATfbnP7sJoShtvL7AMs
ej5BXM2pS3YyhF1ZFYbr8z3RzVISzbXY+SKeOJIQpMazHQabvaRUo/FHDGHpNTUK
9TQgdtqxyag4QP07FslfG3Kx3j2FnNDI2gexzX7Gdm5aDR0CKOIekOk/tNxsUcK3
ba5RLvfIDYLkrpeyzC20MRMdhPhTuNU++1u85hdOrYTMAzsgrZM/9uDofwn3VgTq
xmJZYzfhtEYWyD3bTCGdiNtaUFTBUI6Qg3/Q2dK+ACg0lfM+pZVKeEURS7MmduG0
ykg8rB9nUB7N5Hsa1685+LgDsYncRQF3F6AmsoplaEA=
=JxU8
-----END PGP MESSAGE-----



t_pickering,
Please respond and let us know how we can help you with your task.

Top
#16795 - 2002-02-05 08:25 AM Re: Shell Command
t_pickering Offline
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
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1045 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.136 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org