Jump to content


  • 0
cdanna4

specialFolders, the registry ACCESS DENIED

Question

Hello Everyone.

 

I am working on deploying windows 7 using SCCM2007R2. During my deployment I need to add several shortcuts to the special folder ALLUSERSDESKTOP and i also need to write to the runonce registry key. This has failed time and time again for me. When i finally checked the logs and manually running the script on a freshly imaged machine. I was getting an access denied error.

 

I was wondering if anyone could lend me a hand with getting this task completed. Is it possible to write to these locations during OSD? I am trying to accomplish this using VBscripts.

 

Thank you in advance for taking a look.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

You should be trying to put the files in the C:\Users\Public\Desktop folder. If that doesn't help, can you share some of your script code so we can see what it's doing? And have you created a package from your script, and are running it as you would a normal piece of software in your task sequence?

 

Here's a VBScript code snippet that shows how to snag the location of the folder and set it as a variable.

strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")

 

And here's another VBScript snippet to show you how you can create shortcuts on-the-fly:

Set strShortcutItem = objWshShell.CreateShortcut(strAllUsersDesktopPath & "\MyShortcut.lnk")

strShortcutItem.TargetPath = """" & strProgramFiles & "\Folder1\Program.exe"""

strShortcutItem.WorkingDirectory = strProgramFiles & "\Folder1"

strShortcutItem.Description = "A comment about my shortcut."

strShortcutItem.Save

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.