How do I edit the path statement and add some new text

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Zeke

How do I edit the path statement and add some new text

Post by Zeke » Fri Aug 20, 2004 1:29 am

I have a path statement on a computer. I want to edit this path statement and add the following - C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA at the "end" of the path:

\....\;....\;.....\;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA.

How can I do this with Macro Scheduler??

Thanks for any hints.

John

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Aug 20, 2004 2:00 am

Let>RP_WAIT=1
Run Program>command.com /c SET path=%path%;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA
Let>RP_WAIT=0

Note: use command.com for WIN9x systems, use cmd for NT/XP/2X systems

-------------------
Edited per Lumumba's following reminder. Added the very important SET command in front.
Last edited by Bob Hansen on Fri Aug 20, 2004 8:27 pm, edited 5 times in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Fri Aug 20, 2004 2:18 pm

To get the complete picture, have a look at the DOS command set /? at the commandline ...

-----

Hi Bob,
That one's for you :wink:

Let>COMSPECs=Note: use command.com for WIN9x systems, use cmd for NT/XP/2X systems
Send>%COMSPECs%

With AHK it would be (press F2 to fire it as often you like - once the script has been executed)
F2::Note:`nuse command.com for WIN9x systems`nuse cmd for NT/XP/2X systems

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Aug 20, 2004 4:34 pm

Thanks Lumumba. I corrected my original posting.

AHK = Assign Hot Key?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Fri Aug 20, 2004 6:14 pm

*.ahk (file extension)
Well, the keword(s) hot key points to the right direction :wink:

Lumumba

Post by Lumumba » Fri Aug 20, 2004 6:16 pm

keword ? :arrow: keyword :lol:

Zeke

Re: Editing Path Statement

Post by Zeke » Fri Aug 20, 2004 8:15 pm

Bob Hansen wrote:Let>RP_WAIT=1
Run Program>command.com /c
SET path=%path%;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA
Let>RP_WAIT=0


Note: use command.com for WIN9x systems, use cmd for NT/XP/2X systems

-------------------
Edited per Lumumba's following reminder. Added the very important SET command in front.
.

When I tried this code snippet, I get the following error message:


"Specified Window "Path=%path%;c:\lotus\notes;c:\lotus\notes\data" not present. Any subsequant key sends in script may cause exceptions.

I only have the options of Abort or Ignore. If I ignore, nothing happens.

Am I doing something wrong?

John

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Aug 20, 2004 8:32 pm

Sorry, this may be from a display problem on the forum. Looks OK in preview mode, but is wrong in final display.

The following is a single line of script, should all be on one line:
Run Program>command.com /c SET path=%path%;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA
==============================
There is a space character after SET, before path=

Also remember if doing cut/paste from forum to remove any trailing spaces from lines of code. you can do this in Macro Scheduler Editor, Edit, Show All Chars, and Remove Trailing Spaces.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

zeke

Re: editing path statement

Post by zeke » Fri Aug 20, 2004 9:03 pm

Bob Hansen wrote:Sorry, this may be from a display problem on the forum. Looks OK in preview mode, but is wrong in final display.

The following is a single line of script, should all be on one line:
Run Program>command.com /c SET path=%path%;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA
==============================
There is a space character after SET, before path=

Also remember if doing cut/paste from forum to remove any trailing spaces from lines of code. you can do this in Macro Scheduler Editor, Edit, Show All Chars, and Remove Trailing Spaces.

Thanks Bob, I made this code snippet all one line - that elminated the previous error. However when I check the path under the environment variables for the system path I still do not see any new entries. I even restarted the computer to see if this helped - no go.

As an alternative approach, I have tried using pathman from the w2k resource kit - it "does" seem to append new entries to the path statement quite easily.

I am finding all kinds of uses for Macro Scheduler - a really great product!

Thanks again.

John

Lumumba

Post by Lumumba » Fri Aug 20, 2004 10:31 pm

I guess you're trapped by a "nice to have" in Bob's advise - the standard environment variable named path !. As MSched ignores those variables (it uses its own "system variables" and "path" isn't one of it) the following "replacement section" seems not to work:

path=%path%;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA

Other scripting tools are working with DOS vars. MSched not directly (check if accessible via VBScript). But maybe I'm wrong. 8)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Aug 20, 2004 10:58 pm

Sorry, I never tested the one line script in Macro Scheduler. I thought it was a "gimmee."
SET path=%path%;C:\LOTUS\NOTES;C:\LOTUS\NOTES\DATA runs fine in a command prompt window.

But does not appear to work in Macro Scheduler with Run Program>.....do not know why, needs to be understood....why not?

In meantime, check out Xset
======================
From notes I copied when first used about a year ago:
XSET allows you to put EVERYTHING you want in a variable of the current DOS, Windows, Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP or OS/2 environment and use it as if you had assigned it the value with the standard command SET. You will be able to write very efficient batch files including string manipulation, calculation, ...

XSET is the most powerful environment variable manipulation program you have ever seen. It also has a very easy and intuitive user interface (very close to the SET command) you only need to use the functionality you need, you do not have to worry about the functionality you do not use. It is not a resident program; so it will not interfere with any of your other applications.

XSET is fully compatible with MS-DOS (from 3.30), DR-DOS, NDOS, 4DOS, OS/2, all Windows.

XSET is a shareware program. Just try it for free (this is a full-featured version - no limitation) and register if you like it. Otherwise, just delete it.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Fri Aug 20, 2004 11:19 pm

runs fine in a command prompt window
Yep, the command interpreter cmd.exe/command.com knows how to deal with the environment variable named path. MSched doesn't know it and therefore ignores it.
Does that makes sense ?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts