Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts not modified due to not resolving (roaming) appdata folder correctly #76

Open
rweijnen opened this issue Oct 29, 2019 · 0 comments

Comments

@rweijnen
Copy link

rweijnen commented Oct 29, 2019

concfg uses the following code to resolve roaming application data folder:
$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\<etc>

However in some (Enterprise) environments, the folder is redirected to a location outside the users profile folder (e.g. on a network share or on a different drive).

I would suggest to resolve the path like this:
[environment]::GetFolderPath("applicationdata")

Or if it's the Start Menu folder you can query the path directly:

[environment]::GetFolderPath("StartMenu")

Output in my environment:

PS C:\> [environment]::GetFolderPath("StartMenu")
D:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu
PS C:\> "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu"
C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants