Instead of showing
C:\Users\test_user\Documents\Folder\etc
show
\etc
or if possible limit it to a certain number
\Document\Folder\etc
Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory. Use the /D switch to change the current drive in addition to changing the current directory for a drive.
The current directory is the current working directory, and is first in the search order when working with REXX File System (RFS). The current directory can be set using the CD command, CD. The CD command has a similar format to the cd command in operating systems such as DOS.
To change current working directory under the current drive, use command " cd new-path " (change directory). It is important to take note that you need to set the current drive first (via " x: " command) before setting the current directory under the current drive.
You can use the DIR command by itself (just type “dir” at the Command Prompt) to list the files and folders in the current directory.
Change the prompt to show current folder without full path and greater than symbol at the end: Show activity on this post. As an additional note, I couldn't do Synetech's command until I first created the $profile. Type $profile and hit enter. This will display the profile path PowerShell relies on, even if it doesn't exist (it didn't for me).
Change Directories Using the Drag-and-Drop Method. If the folder you want to open in Command Prompt is on your desktop or already open in File Explorer, you can quickly change to that directory. Type cd followed by a space, drag and drop the folder into the window, and then press Enter. The directory you switched to will be reflected in ...
If the folder you want to open in Command Prompt is on your desktop or already open in File Explorer, you can quickly change to that directory. Type cd followed by a space, drag and drop the folder into the window, and then press Enter. The directory you switched to will be reflected in the command line.
<# FileName: promptPsShort.ps1 To set the prompt to the last folder name in the path: > function prompt {$l=Get-Location; $p="$l".split ("") [-1]; "PS $p> "} # works at cmd prompt, BUT NOT DIREECTLY from a .ps1 file.
If you check in help prompt /?
there are two options that can either show the current drive or full path.
I would suggest to use new line option along with the Drive so that you will get more space to view/type the command using below combination.
prompt $P$_$G
With this you will be able to see the Path in the line above the prompt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With