Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I need to find a way to display a truncated working path in the prompt, since the full path can take up quite a bit of room at times. Should I create a variable from the path and truncate the variable somehow (perhaps by parsing backwards character by character until a \ or something)? This seems more complicated than it needs to be!
Ideally, instead of:
prompt [%user%$b$p]$g
[paul|C:\cdp\users\paul\working_cdp\bin]>I would rather see:
[paul|~bin]>Any thoughts?! (by the way, my students use different user names to log on, so I really need to display the %user% at the beginning--I know that adds a few characters...)
Any thoughts are greatly appreciated!
Thanks,
Paul

"This seems more complicated than it needs to be!"
Yeah, but I think you're stuck with parsing it and setting a var.
How to parse? hmmmm
If each user will stay in one dir, life gets easier.
If at first you don't succeed, you're about average.M2

Right...
I've actually disabled navigation away from their home directories, so I may just create a mask for cd--I could have a fixed path to the user folder with the variable path after (I need to emulate typical cd things . .., etc.).
d:\users\%user%\%usrpath%
If that's the case, I'm already half-way there... I just need to figure out the parsing stuff!
Thanks for the input--I just wanted to make sure I wasn't overlooking a simple solution!

Long pathnames can be assigned drive letters with SUBST
Resist the temptation to close your request for help with semantically-null questions like “Can anyone help me?”

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |