Get "My Documents" folder path: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.)
m (Adding new author and category links.)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{PageAuthor|Joel}}
== Description ==
== Description ==
'''Superseded by:''' NSIS RC1 - $DOCUMENTS variable.
'''Superseded by:''' NSIS RC1 - $DOCUMENTS variable.
Line 8: Line 10:
; This Function will display "My Documents" Folder path.
; This Function will display "My Documents" Folder path.
; Now it suppose to work with multiple users.
; Now it suppose to work with multiple users.
; Created by Lobo Lunar
; Created by Joel


Name "Get My Documents Path"
Name "Get My Documents Path"
Line 14: Line 16:


Function "GetMyDocs"
Function "GetMyDocs"
ReadRegStr $0 HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" Personal
  ReadRegStr $0 HKCU \
            "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" \
            Personal
FunctionEnd
FunctionEnd


Function .onInit
Function .onInit
Call "GetMyDocs"
  Call "GetMyDocs"
MessageBox MB_OK|MB_ICONINFORMATION $0
  MessageBox MB_OK|MB_ICONINFORMATION $0
Quit
  Quit
FunctionEnd
FunctionEnd


Section -Ghost
Section -Ghost
; Nothing here, :p
  ; Nothing here, :p
Sectionend
Sectionend
</highlight-nsis>
</highlight-nsis>


Page author: [[User:Joelito|Joelito]]
[[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