Hi
I am trying to change properties of a ShortCut in my Windows Menu using following C# code .
This works perfectly fine when i am logged in as the Windows Admin. But when i attempt to do the same as a limited user, i get access denied error.
Is there any workaround for this issue ??
Thanks n Regards
Anu Viswan
I am trying to change properties of a ShortCut in my Windows Menu using following C# code .
Code Snippet
string path = Environment.GetFolderPath(Environment.SpecialFolder.Programs);
path = path.Replace(Environment.UserName, "All Users");
Shell32.ShellClass shl = new Shell32.ShellClass();
Shell32.Folder dir = shl.NameSpace(path);
if(dir != null)
{
Shell32.FolderItem itm = dir.Items().Item("Friends" + ".lnk");
if(itm != null)
{
Shell32.ShellLinkObject lnk = (Shell32.ShellLinkObject)itm.GetLink;
if(lnk != null)
{
lnk.Arguments = "anu";
lnk.Save(null);
}
}
}
This works perfectly fine when i am logged in as the Windows Admin. But when i attempt to do the same as a limited user, i get access denied error.
Is there any workaround for this issue ??
Thanks n Regards
Anu Viswan