Shortcut for desktop in cmd

Is there any shortcut for desktop in windows command prompt ? (like %WINDIR% for windows directory)
I want to use cd %DESKTOP% for example.

1 Answer

Closest thing to that (without you setting your own Variable) is

cd %UserProfile%\Desktop

Beyond that you can set your own Variable:

SET DESKTOP=%USERPROFILE%\Desktop

And then cd %Desktop% will bring you to x:\Users\YourUserName\Desktop

For Command Line options to do the same:
setx desktop "%userprofile%\desktop" for User Variable
setx desktop "%userprofile%\desktop" /M for Computer/System-wide Variable

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like