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
lz7cjcAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Praveen Kumar BonalaProgrammer AnalystCommented:
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:\
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
If you can use shortcuts to start each, set the working directory in the shortcut properties.
0
lz7cjcAuthor Commented:
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
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
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.
0
lz7cjcAuthor Commented:
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
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
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.
0
lz7cjcAuthor Commented:
ok great
will try it now
0
lz7cjcAuthor Commented:
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?
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
For "DOS" you need to link to cmd.exe in %WinDir%\system32 (or just use %ComSpec%, which should point to the exe).
Sounds as if you called command.exe, which is for compatibility with very ancient stuff only.

Also note that the per-window settings are based on the initial window title. The default settings are not, and applied always if there is no per-window one.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lz7cjcAuthor Commented:
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
0
lz7cjcAuthor Commented:
oh and can't use comspec since am told it is in use by Avast
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
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"
0
lz7cjcAuthor Commented:
yes - so it is - sorry was half asleep
all sorted - thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.