Get "My Documents" folder path: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Added category links.)
m (Adding new author and category links.)
 
Line 1: Line 1:
{|align=right
{{PageAuthor|Joel}}
|<small>Author: [[{{ns:2}}:Joel|Joel]] ([[{{ns:3}}:Joel|talk]], [[{{ns:-1}}:Contributions/Joel|contrib]])</small>
 
|}
<br style="clear:both;">
== Description ==
== Description ==
'''Superseded by:''' NSIS RC1 - $DOCUMENTS variable.
'''Superseded by:''' NSIS RC1 - $DOCUMENTS variable.
Line 34: Line 32:
</highlight-nsis>
</highlight-nsis>


[[{{ns:14}}:Disk, Path & File Functions]]
[[Category:Disk, Path & File Functions]]

Latest revision as of 12:17, 24 June 2005

Author: Joel (talk, contrib)


Description

Superseded by: NSIS RC1 - $DOCUMENTS variable.

This script detects the user's "My Documents" folder path.

The Script

; This Function will display "My Documents" Folder path.
; Now it suppose to work with multiple users.
; Created by Joel
 
Name "Get My Documents Path"
OutFile "GetMyDocPath.exe"
 
Function "GetMyDocs"
  ReadRegStr $0 HKCU \
             "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" \
             Personal
FunctionEnd
 
Function .onInit
  Call "GetMyDocs"
  MessageBox MB_OK|MB_ICONINFORMATION $0
  Quit
FunctionEnd
 
Section -Ghost
  ; Nothing here, :p
Sectionend