You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
'Uses API: SHGetFolderPath
#Compile Exe
#Dim All
#Include "win32api.inc"
Function PBMain () As Long
Dim strPath As Asciiz * %MAX_PATH
SHGetFolderPath(0, %CSIDL_DESKTOPDIRECTORY, 0, 0, strPath)
End Function
'%CSIDL_DESKTOPDIRECTORY DeskTop
'%CSIDL_PROGRAM_FILES Program Files
'%CSIDL_SYSTEM System folder
'%CSIDL_WINDOWS Windows directory
'%CSIDL_DESKTOP <desktop>
'%CSIDL_PROGRAMS Start Menu\Programs
'%CSIDL_PERSONAL My Documents
'%CSIDL_STARTUP Start Menu\Programs\Startup
'%CSIDL_MYDOCUMENTS logical "My Documents" desktop icon
'%CSIDL_DESKTOPDIRECTORY <user name>\Desktop
'%CSIDL_DRIVES My Computer
'%CSIDL_FONTS windows\fonts
Hi All,
How can I get the name of the windows main folder, as a text string?
It's usually "c:\windows", but I've come across a few instances where other names are used:
c:\winnt
c:\win2000
c:\winme
c:\captkirk
amongst others. Is there a relatively simple way to get this into a string, so that I can, for example, add the string "system32\" to the variable MyWinFolder$ to get a valid path?
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: