Link to home
Start Free TrialLog in
Avatar of lz7cjc
lz7cjc

asked on

How do I change the default path in powershell?

Hi
I am running Windows 8.1 and want to change the default path when i open up DOS and Powershell. How do I do that?
thanks
Avatar of Praveen Kumar Bonala
Praveen Kumar Bonala
Flag of India image

Use "Set-location" command let. which is equal to cd command.
Ex:> Set-Location c:\scripts

> Set-Location HKCU:\Software\Microsoft\Windows

> Set-Location D:\
If you can use shortcuts to start each, set the working directory in the shortcut properties.
Avatar of lz7cjc
lz7cjc

ASKER

thanks - they are pinned to my start menu and don't get an option to choose properties.

As for set-location, it sounds like I use that once the program is open. I would like it to open by default to e.g.  c:\users\user\document\mdefaultfolder - every time I open Dos or Powershell.

thanks
Yes, you can only pin executables, no shortcuts. If you need that, sorry, you have to run the CD or set-location each time.
You should either use Toolbars in the task bar (and have the shortcuts set up as described above), or put those shortcuts onto desktop and/or your start menu.
Avatar of lz7cjc

ASKER

ok understood - toolbars in the taskbar? would that enable me to put shortcuts on taskbar? that sound like a good happy medium. How do i do that? I can see the option to create a toolbar but not sure how to get the two shortcuts i need on there
You have to create a folder first, and then provide the path to that folder in the New Toolbar dialog. Then create your shortcuts in the folder you created, or drag existing shortcuts to the toolbar.
Avatar of lz7cjc

ASKER

ok great
will try it now
Avatar of lz7cjc

ASKER

not as easy i had hoped! I have found where powershell is but not DOS - any ideas?

I have changed the properties to increase the font and window size, and when it launches it launches as intended but then shrinks to a tiny size. i then edited the properties in the window and the default settings but it still doesn't behave how i want.

Finally what is the syntax for the path? Does %% indicate a sub folder? I have tried using that but now it defaults to system32 not even users!

 Is this a new question or are you happy answering here?
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lz7cjc

ASKER

thanks but there is no command.exe in %WinDir%\system32\

For powershell

the path doesn't change on opening: I have entered:
%HOMEDRIVE%%HOMEPATH\DOCUMENT\CODING\WEBSITES_GO_HERE
as well as
%HOMEDRIVE%%HOMEPATH%%DOCUMENT%%CODING%%WEBSITES_GO_HERE
and
%HOMEDRIVE%%HOMEPATH/DOCUMENT/CODING/WEBSITES_GO_HERE
but it opens up windows\system32
Avatar of lz7cjc

ASKER

oh and can't use comspec since am told it is in use by Avast
thanks but there is no command.exe in %WinDir%\system32\
Of course not. I referred to cmd.exe.

Regarding the paths you tried, they are probably all invalid. The first one is missing a %. You should also try step by step - %HOMEDRIVE%%HOMEPATH% works, but is the same as the default dir.
The "Document" folder does not exist, it is "Documents"
Avatar of lz7cjc

ASKER

yes - so it is - sorry was half asleep
all sorted - thanks for your help