A version of this page is also available for
This function will search for the first storage card and construct the path that is used to look for an autorun file. The autorun file and directory do not need to be present on the storage card, but a storage card must be inserted for this function to succeed.
BOOL SHGetAutoRunPath( LPTSTR pAutoRunPath );
[out] Pointer to a user-allocated string allocated to at least MAX_PATH characters. If successful, the full path name to the autorun directory will be copied here (for example, \Storage Card 1\2577\autorun.exe).
Returns TRUE if a path was successfully constructed and copied to pAutoRunPath. Returns FALSE if a path could not be copied. FALSE indicates that either the input parameter is invalid or a storage card is not currently inserted.
This function returns a string in the form \Storage Card 1\2577\autorun.exe. The operating system (OS) looks for the file autorun.exe in an appropriate subdirectory, which should be named using the microprocessor ID number found in Winnt.h.
Note Windows Mobile only supports processors based on the ARM architecture.
You can call GetSystemInfo to determine the microprocessor type and architecture for your device.
Windows Mobile is compatible with ARM-based processors. The CPU type value for supported processors is 2577.
If autorun.exe is not found in the processor-specific subdirectory, SHGetAutoRunPath will return \<Storage Card>\0\autorun.exe, which indicates a special processor type of 0 for a CEF executable. For example, if the storage card contained 2577\autorun.exe and 0\autorun.exe, the executable file in 2577\ would be run on an ARM (SA1100) device; on another device, the executable file in 0\ would be run. As with the old name-based implementation, you may make these folders hidden to avoid cluttering up the folder view in applications like the File Explorer.
After autorun.exe begins to run, it is sometimes useful for it to know which directory it is running from. Autorun.exe can then determine how to manage files or take actions based on its location in the system.
|Windows Embedded CE||Windows CE .NET 4.2 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|