Windows 7: Opening Command Prompt with Shortcut Icon in Directory of Icon

I am trying to open the command prompt for the directory that the shortcut icon is currently located in. However, I want to be able to move this given icon to another directory (using my mouse to drag it into a new folder in the Windows Explorer) and be able to double click it to open the command prompt in that new directory.

I am wanting to use something along the lines of “cmd /k “cd cwd” & {other commands}” where cwd would give the current working directory that the icon is located in.

I am having issues because I cannot just use ‘cmd-here’ in the target line.

Any suggestions?

This is the current configuration I have.

enter image description here

Solution:

Force a CMD shortcut to open in a directory the shortcut resides

Simply put %cd% into the Start in: field and this will ensure the cmd.exe opens in whatever folder the shortcut resides at the time of executionβ€”I’ve tested this and confirmed it to work just as described (and requested) on both Windows 7 and Windows 10.

enter image description here


Further Resources

  • cd

    Β 

    Display the current drive and directory:

    C:Work> ECHO "%CD%"
πŸ’ 

πŸ”΅ Best-selling hard drives, USB flash drives & SSDs everyone's buying.

Fast, reliable, and on sale now. Thousands pick these weekly β€” don't miss Amazon's lowest storage prices.

⚑ Top 10 Bestsellers
πŸ† 4.7β˜…+ Reviews
πŸ“¦ Prime Shipping
πŸ‘‰ See today's best-selling Data storage on Amazon.com HDD Β· USB Flash Drives Β· SSD Β· External Drives
πŸ›’
βœ… Updated hourly β€” Amazon real-time ranking πŸ”₯ Limited stock deals πŸ”— Affiliate
⭐ Click to see complete best-selling list ⭐
Scroll to Top