Community Discussions and Support
Sort addressbook by Key

Thanks, changed to reporting level 5 and confirmed the addressbook. The batch file still isn't working though, must be doing something wrong...

 Steve

<p>Thanks, changed to reporting level 5 and confirmed the addressbook. The batch file still isn't working though, must be doing something wrong...</p><p> Steve </p>

Version 4.61.  Is there any way to set the address book default to sort by Key, so the setting is sticky? (keeps reverting back to Name sort)  Thanks!

 

...Steve

<p>Version 4.61.  Is there any way to set the address book default to sort by Key, so the setting is sticky? (keeps reverting back to Name sort)  Thanks!</p><p> </p><p>...Steve </p>

See command line program pmsort.exe in the Pegasus \Programs\ directory.

Help and important information is available via command pmsort with no argument.

<p>See command line program pmsort.exe in the Pegasus \Programs\ directory.</p><p>Help and important information is available via command pmsort with no argument.</p>

Thanks Guy. Not sure how to use this file - tried clicking on it, got a flash of command line interface which promptly disappeared.

Thanks Guy. Not sure how to use this file - tried clicking on it, got a flash of command line interface which promptly disappeared.

[quote user="weamish"]Thanks Guy. Not sure how to use this file - tried clicking on it, got a flash of command line interface which promptly disappeared.[/quote]

Open a command line window and try again ... well, people might not know about using this anymore these days, please get back here if you don't ...

<p>[quote user="weamish"]Thanks Guy. Not sure how to use this file - tried clicking on it, got a flash of command line interface which promptly disappeared.[/quote]</p><p>Open a command line window and try again ... well, people might not know about using this anymore these days, please get back here if you don't ...</p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

Ran pmsort under cmd line - says it's for "large address books which do not change. PM will use the Key index file but will not maintain it."

I have a large address book file, but it changes regularly. Sounds like there's no way to maintain a Key index sort?

<p>Ran pmsort under cmd line - says it's for "large address books which do not change. PM will use the Key index file but will not maintain it."</p><p>I have a large address book file, but it changes regularly. Sounds like there's no way to maintain a Key index sort? </p>

Below find two example scripts which may be run on demand or via a schedule.

 

    @ECHO OFF
    TASKLIST | FIND "winpm-32.exe" && GOTO :EOF
    CD/d "C:\PMAIL\MAILBOX"
    IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK
    ATTRIB "ADDRBOOK.PMR" | FIND "A  "|| GOTO :EOF
    :SORTBOOK
    PATH="C:\PMAIL\PROGRAMS";%PATH%
    PMSORT "ADDRBOOK.PMR" && ATTRIB -a "ADDRBOOK.PMR"


    @ECHO OFF
    :: Handle v3.46 http://technet.microsoft.com/en-us/sysinternals/bb896655
    HANDLE -p winpm-32.exe | FIND /i "ADDRBOOK.PMR" && GOTO :EOF
    CD/d "C:\PMAIL\MAILBOX"
    IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK
    ATTRIB "ADDRBOOK.PMR" | FIND "A  "|| GOTO :EOF
    :SORTBOOK
    PATH="C:\PMAIL\PROGRAMS";%PATH%
    PMSORT "ADDRBOOK.PMR" && ATTRIB -a "ADDRBOOK.PMR"

<P>Below find two example scripts which may be run on demand or via a schedule.</P> <P mce_keep="true"> </P> <P>    @ECHO OFF     TASKLIST | FIND "winpm-32.exe" && GOTO :EOF     CD/d "C:\PMAIL\MAILBOX"     IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK     ATTRIB "ADDRBOOK.PMR" | FIND "A  "|| GOTO :EOF     :SORTBOOK     PATH="C:\PMAIL\PROGRAMS";%PATH%     PMSORT "ADDRBOOK.PMR" && ATTRIB -a "ADDRBOOK.PMR"</P> <P>     @ECHO OFF     :: Handle v3.46 <A href="http://technet.microsoft.com/en-us/sysinternals/bb896655">http://technet.microsoft.com/en-us/sysinternals/bb896655</A>     HANDLE -p winpm-32.exe | FIND /i "ADDRBOOK.PMR" && GOTO :EOF     CD/d "C:\PMAIL\MAILBOX"     IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK     ATTRIB "ADDRBOOK.PMR" | FIND "A  "|| GOTO :EOF     :SORTBOOK     PATH="C:\PMAIL\PROGRAMS";%PATH%     PMSORT "ADDRBOOK.PMR" && ATTRIB -a "ADDRBOOK.PMR" </P>

Thanks Guy. Is there a how-to guide for running scripts? Do I save these as a batch file or something?

 

...Steve

<p>Thanks Guy. Is there a how-to guide for running scripts? Do I save these as a batch file or something?</p><p> </p><p>...Steve </p>

[quote user="weamish"]Thanks Guy. Is there a how-to guide for running scripts? Do I save these as a batch file or something?[/quote]

Looks pretty much like batch scripts ...

<p>[quote user="weamish"]Thanks Guy. Is there a how-to guide for running scripts? Do I save these as a batch file or something?[/quote]</p><p>Looks pretty much like batch scripts ...</p>
			Michael
--
IERenderer's Homepage
PGP Key ID (RSA 2048): 0xC45D831B
S/MIME Fingerprint: 94C6B471 0C623088 A5B27701 742B8666 3B7E657C

Looking at the first suggested script -

1.  There is no directory named \PMAIL\MAILBOX - is this supposed to be the location of the ADDRBOOK.PMR files? I have \PMAIL\MAIL and |PMAIL\PROGRAMS

2.   Do I replace FIND winpm32.exe with the actual location of this file?

3.   After ATTRIB, I assume I'm supposed to replace all the ADDRBOOK.PMR references with the actual filename?

4.  The last PATH statement refers to the location of the ADDRBOOK.PMR files?

Thanks!

<p>Looking at the first suggested script -</p><p>1.  There is no directory named \PMAIL\MAILBOX - is this supposed to be the location of the ADDRBOOK.PMR files? I have \PMAIL\MAIL and |PMAIL\PROGRAMS </p><p>2.   Do I replace FIND winpm32.exe with the actual location of this file?</p><p>3.   After ATTRIB, I assume I'm supposed to replace all the ADDRBOOK.PMR references with the actual filename?</p><p>4.  The last PATH statement refers to the location of the ADDRBOOK.PMR files?</p><p>Thanks! </p>

Below I try to translate the first script, also see logic flowchart image.

[quote]
    @ECHO OFF
    TASKLIST | FIND "winpm-32.exe" && GOTO :EOF
[/quote]

@ECHO OFF = Turn command-echoing off.
TASKLIST = Displays a list of running applications.
| = Pipeline output of Left-Side to input of Right-Side.
FIND = Search for a text string.
&& = If Left-Side of statement is True, do the Right-Side of statement.
GOTO :EOF = Go to the End Of File; quit.

List all running applications, if the Pegasus executable IS found quit.

[quote]
    CD/d "C:\PMAIL\MAILBOX"
[/quote]

Change the Current Directory, including the Drive to the Right-Side.

[quote]
    IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK
[/quote]

If the Sorted Address Book Index file (.pm1) does not exist go to the Label named SORTBOOK

[quote]
    ATTRIB "ADDRBOOK.PMR" | FIND "A  "|| GOTO :EOF
[/quote]

ATTRIB = Displays or changes file attributes.
|| = If Left-Side of statement is False, do the Right-Side of statement.

Display the file attributes of the Address Book file (.pmr), if the Archive bit attribute IS NOT found quit.

[quote]
    :SORTBOOK
    PATH="C:\PMAIL\PROGRAMS";%PATH%
    PMSORT "ADDRBOOK.PMR" && ATTRIB -a "ADDRBOOK.PMR"
[/quote]

:SORTBOOK = Label that batch can be directed to GOTO

Add the directory which contains the PMSORT utility to the PATH variable.
(This is only done to avoid the need to include the fully qualified path name of PMSORT.EXE).
Sort the Address Book file(creates .pm1), if successfull, remove the Archive bit attribute Address Book file.

When the Address Book is changed by Pegasus the Archive bit will be turned On (next time the script is run the Sort the Address Book).


flowchart

<P>Below I try to translate the first script, also see logic flowchart image.</P> <P>[quote]     @ECHO OFF     TASKLIST | FIND "winpm-32.exe" && GOTO :EOF [/quote]</P> <P>@ECHO OFF = Turn command-echoing off. TASKLIST = Displays a list of running applications. | = Pipeline output of Left-Side to input of Right-Side. FIND = Search for a text string. && = If Left-Side of statement is True, do the Right-Side of statement. GOTO :EOF = Go to the End Of File; quit.</P> <P>List all running applications, if the Pegasus executable IS found quit.</P> <P>[quote]     CD/d "C:\PMAIL\MAILBOX" [/quote]</P> <P>Change the Current Directory, including the Drive to the Right-Side.</P> <P>[quote]     IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK [/quote]</P> <P>If the Sorted Address Book Index file (.pm1) does not exist go to the Label named SORTBOOK</P> <P>[quote]     ATTRIB "ADDRBOOK.PMR" | FIND "A  "|| GOTO :EOF [/quote]</P> <P>ATTRIB = Displays or changes file attributes. || = If Left-Side of statement is False, do the Right-Side of statement.</P> <P>Display the file attributes of the Address Book file (.pmr), if the Archive bit attribute IS NOT found quit.</P> <P>[quote]     :SORTBOOK     PATH="C:\PMAIL\PROGRAMS";%PATH%     PMSORT "ADDRBOOK.PMR" && ATTRIB -a "ADDRBOOK.PMR" [/quote]</P> <P>:SORTBOOK = Label that batch can be directed to GOTO</P> <P>Add the directory which contains the PMSORT utility to the PATH variable. (This is only done to avoid the need to include the fully qualified path name of PMSORT.EXE). Sort the Address Book file(creates .pm1), if successfull, remove the Archive bit attribute Address Book file.</P> <P>When the Address Book is changed by Pegasus the Archive bit will be turned On (next time the script is run the Sort the Address Book).</P> <P> <IMG style="WIDTH: 513px; HEIGHT: 435px" title=flowchart alt=flowchart align=absBottom src="http://oi52.tinypic.com/2cfa721.jpg" width=513 height=435 mce_src="http://oi52.tinypic.com/2cfa721.jpg"></P>

[quote]
Looking at the first suggested script -
1.  There is no directory named \PMAIL\MAILBOX - is this supposed to be the location of the ADDRBOOK.PMR files?
    I have \PMAIL\MAIL and |PMAIL\PROGRAMS
[/quote]

Yes.

[quote]
2.  Do I replace FIND winpm32.exe with the actual location of this file?
[/quote]

No, see "translation" posting.

[quote]
3.  After ATTRIB, I assume I'm supposed to replace all the ADDRBOOK.PMR references with the actual filename?
[/quote]

Yes, e.g. PERSONAL.PMR, ADDR0001.PMR

[quote]
4.  The last PATH statement refers to the location of the ADDRBOOK.PMR files?
[/quote]

No, see "translation" posting.

<P>[quote] Looking at the first suggested script - 1.  There is no directory named \PMAIL\MAILBOX - is this supposed to be the location of the ADDRBOOK.PMR files?     I have \PMAIL\MAIL and |PMAIL\PROGRAMS [/quote]</P> <P>Yes.</P> <P>[quote] 2.  Do I replace FIND winpm32.exe with the actual location of this file? [/quote]</P> <P>No, see "translation" posting.</P> <P>[quote] 3.  After ATTRIB, I assume I'm supposed to replace all the ADDRBOOK.PMR references with the actual filename? [/quote]</P> <P>Yes, e.g. PERSONAL.PMR, ADDR0001.PMR</P> <P>[quote] 4.  The last PATH statement refers to the location of the ADDRBOOK.PMR files? [/quote]</P> <P>No, see "translation" posting. </P>

Here's the bat file I set up, doesn't seem to work yet. Z:\Pegasus is the location of the PMR file.  X:\Pegasus\Programs is the location of the pmsort file.

Incidentally, how do I determine the filename of the address book? I found what I think is the correct one by using a universal file viewer, but is there some way to check this in the program itself?

@ECHO OFF
    TASKLIST | FIND "winpm-32.exe" && GOTO :EOF
    CD/d "Z:\Pegasus"
    IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK
    ATTRIB "ADDR6689.PMR" | FIND "A  "|| GOTO :EOF
    :SORTBOOK
    PATH="X:\Pegasus\Programs";%PATH%
    PMSORT "ADDR6689.PMR" && ATTRIB -a "ADDR6689.PMR"

<p>Here's the bat file I set up, doesn't seem to work yet. Z:\Pegasus is the location of the PMR file.  X:\Pegasus\Programs is the location of the pmsort file.</p><p>Incidentally, how do I determine the filename of the address book? I found what I think is the correct one by using a universal file viewer, but is there some way to check this in the program itself? </p><p>@ECHO OFF     TASKLIST | FIND "winpm-32.exe" && GOTO :EOF     CD/d "Z:\Pegasus"     IF NOT EXIST "ADDRBOOK.PM1" GOTO :SORTBOOK     ATTRIB "ADDR6689.PMR" | FIND "A  "|| GOTO :EOF     :SORTBOOK     PATH="X:\Pegasus\Programs";%PATH%     PMSORT "ADDR6689.PMR" && ATTRIB -a "ADDR6689.PMR" </p>

[quote user="weamish"]

Incidentally, how do I determine the filename of the address book?
[/quote]

Manually I do it by calling address book(s) F3 key and the looking at system messages alt-w-s and book filename and extension will be shown.

 

Fri, 13:19:23 Closed AB index file for 'personal.pmr'

Fri, 13:19:23 Opened AB master file for 'System.pmr'

 

<p>[quote user="weamish"]</p><p>Incidentally, how do I determine the filename of the address book? [/quote]</p><p>Manually I do it by calling address book(s) F3 key and the looking at system messages alt-w-s and book filename and extension will be shown.</p><p> </p><p>Fri, 13:19:23<span class="Apple-tab-span" style="white-space:pre"> </span>Closed AB index file for 'personal.pmr'</p><p>Fri, 13:19:23<span class="Apple-tab-span" style="white-space:pre"> </span>Opened AB master file for 'System.pmr'</p><p> </p>

Thanks Jerry. Tried that, but I don't see any mention of the address book filename in the system messages.

Thanks Jerry. Tried that, but I don't see any mention of the address book filename in the system messages.

[quote user="weamish"]Thanks Jerry. Tried that, but I don't see any mention of the address book filename in the system messages.
[/quote]

I have reporting level 5 set and that may make a difference. 

Sat, 13:53:46 Closed AB index file for 'personal.pmr'

Sat, 13:53:46 Opened AB master file for 'System.pmr'

 

<p>[quote user="weamish"]Thanks Jerry. Tried that, but I don't see any mention of the address book filename in the system messages. [/quote]</p><p>I have reporting level 5 set and that may make a difference. </p><p>Sat, 13:53:46<span class="Apple-tab-span" style="white-space:pre"> </span>Closed AB index file for 'personal.pmr'</p><p>Sat, 13:53:46<span class="Apple-tab-span" style="white-space:pre"> </span>Opened AB master file for 'System.pmr'</p><p> </p>
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft