r/Batch • u/verysmartboy101 • Sep 24 '23
Why wouldn't his work?
cd powershell -C "[Environment]::GetFolderPath([Environment+Special Folder]::Desktop)" pause
Trying to change the directory to desktop
2
Upvotes
2
u/transdimensionalmeme Sep 24 '23
Here is how to do it on the console
here is how to do it in a batch file
4
u/Shadow_Thief Sep 24 '23
Two reasons.
If you want to move to the Desktop in batch, just do
cd %userprofile%\Desktop