Oztaco
Oztaco

Reputation: 3459

Access "Start up" folder from CMD?

How can I get the path of the start up folder from a batch file? The only way I found was to look in the registry but I don't think thats possible with CMD.

Upvotes: 2

Views: 9925

Answers (2)

Sudhakar B
Sudhakar B

Reputation: 1573

In Windows XP you can access like this

CD %HOMEDRIVE%%HOMEPATH%\Start Menu\Programs\Startup

Upvotes: 1

SeanC
SeanC

Reputation: 15923

This will set STARTUP to the location of the startup folder:

for /F "skip=4 tokens=3*" %%j in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Common Startup"') do set STARTUP=%%k

(skip=4 is for XP, use skip=2 for Windows 7. I don't have Vista to try the command there)

Also available (change the value after /v):

Common AppData
Common Programs
Common Documents
Common Desktop
Common Start Menu
CommonPictures
CommonMusic
CommonVideo
Common Templates
Common Favorites
Common Startup
Common Administrative Tools

Upvotes: 2

Related Questions