Page 1 of 1
Getting Startup folder fails as admin
Posted: Thu Aug 29, 2019 2:33 am
by BarryG
Not a bug.
My Win 10 install was only 5 days old, and since I hadn't logged in as admin yet, there was no admin profile created (thus no Startup folder existed for the admin user). The things you learn!
Still, this is something to be aware of in future: your users may be trying your software on a new user profile, which can cause it to fail or return unexpected results. Now I have to amend all my sources to handle such missing profiles; so not a lost cause by posting about it after all.

Re: Getting Startup folder fails as admin
Posted: Thu Aug 29, 2019 6:37 am
by Little John
BarryG wrote:Question 1 of 2:
Code: Select all
recent$=Space(999) : a=0 : SHGetSpecialFolderLocation_(0,#CSIDL_RECENT,@a) : SHGetPathFromIDList_(a,@recent$)
startup$=Space(999) : a=0 : SHGetSpecialFolderLocation_(0,#CSIDL_STARTUP,@a) : SHGetPathFromIDList_(a,@startup$)
Debug recent$ ; C:\Users\Limited\AppData\Roaming\Microsoft\Windows\Recent
Debug startup$ ; C:\Users\Limited\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Works fine here with PB 5.71 LTS (x64), running on an admin account on a Windows 10 (version 1903):
C:\Users\LJ\AppData\Roaming\Microsoft\Windows\Recent
C:\Users\LJ\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
So it seems to be a special problem on
your Windows system.
BarryG wrote:Question 2 of 2:
Can someone who uses a NON-ENGLISH version of Windows 10, please run the following code and tell me what the debug output is?
Code: Select all
smp$=Space(999) : a=0 : SHGetSpecialFolderLocation_(0,#CSIDL_PROGRAMS,@a) : SHGetPathFromIDList_(a,@smp$)
Debug smp$
German Windows 10:
C:\Users\LJ\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Re: Getting Startup folder fails as admin
Posted: Thu Aug 29, 2019 7:43 am
by BarryG
Little John wrote:So it seems to be a special problem on your Windows system.
Confirmed. Edited my first post with an explanation.
Little John wrote:German Windows 10:
C:\Users\LJ\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Thanks! Good to see that the text is in English.
Re: Getting Startup folder fails as admin
Posted: Thu Aug 29, 2019 12:50 pm
by Little John
BarryG wrote:My Win 10 install was only 5 days old, and since I hadn't logged in as admin yet, there was no admin profile created (thus no Startup folder existed for the admin user).
That's a pretty special situation. However, our programs must be able to deal with this appropriately. So thank you for bringing this problem to my attention.

Re: Getting Startup folder fails as admin
Posted: Thu Aug 29, 2019 1:12 pm
by BarryG
Yep, just goes to show that you can't always plan for everything.