Skip to content

Run Elevated Command Prompt during OSD

Featured Replies

I would like to add a step to my task sequence to copy a couple of files from the SCCM distribution point to the C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories folder. This should be a fairly easy task but this can only be done using an elevated (run as administrator) command prompt. The command looks something like...

 

copy "\\SCCM\Sources\Shortcuts\Internet Explorer.lnk" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories"

 

Is there an easy way to do this that I'm missing? I'm open to other ideas. I've even tried mounting the .wim file using DISM and trying to add the files that way, but I can't seem to browse the folder structure even once the .WIM is mounted.

  • Author

Hey Garth,

 

Not sure I follow. Are you recommending making a Package/Program for this? I could do that...but I think that I would end up creating a program that runs a script to perform the same operations. Would you expect that to be successful where the 'run cmd line' task might fail? If you meant something else maybe you can elaborate for me?

 

I'll try to whip something up using packages/programs while I await some clarification..

 

Thanks for the input!

Yes, I'm say you should use a Package/program for this.

 

Your command as it sits will fail 100% of the time if you try to copy files using CMD. The reason for the failure is the UNC, When you execute the CMD it executes as local system. This account will NOT have access to the UNC and therefore will fail.

 

This will NOT fail if you use a package/program, as long as the source files are within the package.

  • Author

Worked like a charm, I really should have explored my options a little bit more before making this thread. Thanks for knocking some sense into me Garth.

Join the conversation

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

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.