Jump to content


  • 0
P@docIT

Copying a file to the Public Desktop via a TS

Question

Can someone tell me how to run an elevated command prompt via a TS? I have one TS that copies a folder down from the DP to C:, I then want to copy a shortcut from that folder to the public desktop. When I try this manually I get prompted by UAC to grant admin privileges or I can do it via CMD but it has to be an elevated CMD prompt in order to not get the UAC prompt. Is there a way to tell SCCM to run elevated? I see you can run the TS as a specific user, however my account has local admin rights and I still get the UAC prompt.

 

Thanks,

Mike

 

 

Edit: Updated info: Below is the error from the log. Maybe not an elevation problem. It says it can't find the file specified however, I see that the folder was successfully copied to C: (second quote below)

 

The task sequence execution engine failed executing the action (Copy Webcenter Shortcut) in the group (Helpdesk Apps) with the error code 2147942402

Action output: cuting command line: Run command line

Create a process under given user token

CreateProcessAsUser( m_hUserToken, NULL, (LPWSTR)m_sCommandLine.c_str(), NULL, NULL, TRUE, bNT ? CREATE_NEW_CONSOLE | CREATE_UNICODE_ENVIRONMENT : CREATE_NEW_CONSOLE, m_pEnvironmentBlock, pszWorkingDir, &si, π ), HRESULT=80070002 (e:\nts_sms_fre\sms\framework\core\ccmcore\commandline.cpp,1017)

clCommandLine.Execute( uOptions, pszWorkingDir, lpDesktop ), HRESULT=80070002 (e:\nts_sms_fre\sms\client\osdeployment\installsoftware\runcommandline.cpp,558)

CreateProcessAsUser failed. Code(0x80070002)

Command line execution failed (80070002)

Failed to execute command line 'copy "C:\WebCenter8\WebCenter.url" "C:\Users\Public\Desktop\WebCenter.url"' .

The system cannot find the file specified. (Error: 80070002; Source: Windows)

cmd.Execute(pszPkgID, sProgramName, dwCmdLineExitCode), HRESULT=80070002 (e:\nts_sms_fre\sms\client\osdeployment\installsoftware\main.cpp,385)

Install Software failed to run command line, hr=0x80070002. The operating system reported error 2147942402: The system cannot find the file specified.

 

 

The task sequence execution engine successfully completed the action (Install WebCenter) in the group (Helpdesk Apps) with exit code 0

Action output: =======================[ smsswd.exe ] =======================

PackageID = ''

BaseVar = '', ContinueOnError=''

SwdAction = '0001'

Set command line: Run command line

Working dir 'not set'

Executing command line: Run command line

Process completed with exit code 0

3 File(s) copied

Command line returned 0.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I think i may have figured out the problem. I have the file listed with .url extension however when I show extensions for known files the file still has no extension. The properties show Internet Shortcut (.url) which is why I assumed that there was an extension. Going to test without and will post back.

 

Thanks.

Mike

 

Edit: Well I tried manually with an elevated prompt using the .url ext and it copied fine. So I'm not sure why or what file it can't find.

Share this post


Link to post
Share on other sites

  • 0

Hi,

 

looks like u were trying to call the copy without "cmd /c". copy is a cmd command and no executable.

 

Ohhhhh. I totally misinterpreted how the "run command line" TS worked. I assumed by choosing that option it ran as if I had opened CMD and typed the "command line". Therefore only needing to supply what I would manually type in a command window. Will try again with the cmd /c. Thanks.

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.