Getting Startup folder fails as admin

Windows specific forum
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Getting Startup folder fails as admin

Post 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. :wink:
Last edited by BarryG on Thu Aug 29, 2019 8:01 am, edited 4 times in total.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Getting Startup folder fails as admin

Post 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
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Getting Startup folder fails as admin

Post 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.
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Getting Startup folder fails as admin

Post 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. :-)
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Getting Startup folder fails as admin

Post by BarryG »

Yep, just goes to show that you can't always plan for everything.
Post Reply