Jump to content


sybux

TS - Run a command line from a Package

Recommended Posts

Hi,

 

I'm trying to run a script which is in a package during my TS Deploying Windows.

I've followed this post : http://www.windows-n...task-sequences/

 

I'm getting an error 0x80070002. I don't know why but there is nothing in the smsts.log and I can't open the command prompt during the TS (i've enabled the option under Customization.

 

Finally I've catched a log :

 

 

Expand a string: smsswd.exe /run:HEG00014 .\activateWindows.bat TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

Expand a string: TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

Command line for extension .exe is "%1" %* TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

Set command line: smsswd.exe /run:HEG00014 .\activateWindows.bat TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

Start executing the command line: smsswd.exe /run:HEG00014 .\activateWindows.bat TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

!--------------------------------------------------------------------------------------------! TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

Expand a string: WinPEandFullOS TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

Executing command line: smsswd.exe /run:HEG00014 .\activateWindows.bat TSManager 16.05.2012 16:13:58 3760 (0x0EB0)

[ smsswd.exe ] InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

PackageID = 'HEG00014' InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

BaseVar = '', ContinueOnError='' InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

ProgramName = '.\activateWindows.bat' InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

SwdAction = '0001' InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

DownloadOnDemand flag is true. Attempting to download content locally for Package HEG00014.. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Package Flags: 0x0 InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

GetDirectoryListing() entered InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Initializing HTTP transport. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Setting URL = http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG00014. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Address=http://HEG-36.ge-em.ad.etat-ge.ch, Scheme=http, Object=/SMS_DP_SMSPKG$/HEG00014, Port=80. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Setting Authenticator. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Set authenticator in transport InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

WinHttp credentials set InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

CLibSMSMessageWinHttpTransport::Send: URL: HEG-36.ge-em.ad.etat-ge.ch:80 PROPFIND /SMS_DP_SMSPKG$/HEG00014 InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

401 - Authentication failure on request with anonymous access, retrying with context credentials. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Using thread token for request InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Request was succesful. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

DAV response string is:

<?xml version="1.0" encoding="utf-8" ?><D:multistatus xmlns:D="DAV:"><D:response><D:href>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/sccm?/HEG00014/</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:supportedlock/><D:getetag/><D:creationdate/><D:iscollection>1</D:iscollection><D:resourcetype><D:collection/></D:resourcetype><D:ishidden>0</D:ishidden><D:displayname>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/sccm?/HEG00014/</D:displayname><D:getlastmodified></D:getlastmodified><D:getcontentlanguage/><D:getcontentlength>0</D:getcontentlength></D:prop></D:propstat></D:response><D:response><D:href>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG00014/sccm?/activateWindows.bat.txt</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:lockdiscovery/><D:supportedlock/><D:getetag/><D:getcontentlanguage/><D:iscollection>0</D:iscollection><D:creationdate/><D:resourcetype/><D:ishidden>0</D:ishidden><D:displayname>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG00014/sccm?/activateWindows.bat.txt</D:displayname><D:getlastmodified>Thu, 03 May 2012 08:31:05 GMT</D:getlastmodified><D:getcontentlength>116</D:getcontentlength></D:prop></D:propstat></D:response></D:multistatus> InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

List of files to be downloaded InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

File: http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG00014/sccm?/activateWindows.bat.txt InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

GetDirectoryListing() successfully completed InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Succeeded loading resource DLL 'C:\Windows\CCM\1033\TSRES.DLL' InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

401 - Authentication failure on request with anonymous access, retrying with context credentials. InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Downloaded file from http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG00014/sccm?/activateWindows.bat.txt to C:\_SMSTaskSequence\Packages\HEG00014\activateWindows.bat.txt InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Download done setting progress bar to 100 InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

VerifyContentHash: Hash algorithm is 32780 InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Content successfully downloaded at C:\_SMSTaskSequence\Packages\HEG00014 InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Resolved source to 'C:\_SMSTaskSequence\Packages\HEG00014' InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Command line for extension .bat is "%1" %* InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Set command line: Run command line InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Working dir 'C:\_SMSTaskSequence\Packages\HEG00014' InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Executing command line: Run command line InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

CreateProcess( NULL, (LPWSTR)m_sCommandLine.c_str(), NULL, NULL, TRUE, bNT ? CREATE_UNICODE_ENVIRONMENT : 0, m_pEnvironmentBlock, pszWorkingDir, &si, π ), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\core\ccmcore\commandline.cpp,993) InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

CreateProcess failed. Code(0x80070002) InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Command line execution failed (80070002) InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

clCommandLine.Execute( uOptions, pszWorkingDir, lpDesktop ), HRESULT=80070002 (e:\nts_sccm_release\sms\client\osdeployment\installsoftware\runcommandline.cpp,558) InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Failed to execute command line '.\activateWindows.bat' .

The system cannot find the file specified. (Error: 80070002; Source: Windows) InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\HEG00014 InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

reference count 1 for the source C:\_SMSTaskSequence\Packages\HEG00014 before releasing InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Delete source directory C:\_SMSTaskSequence\Packages\HEG00014 InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Released the resolved source C:\_SMSTaskSequence\Packages\HEG00014 InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

cmd.Execute(pszPkgID, sProgramName, dwCmdLineExitCode), HRESULT=80070002 (e:\nts_sccm_release\sms\client\osdeployment\installsoftware\main.cpp,372) InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Install Software failed to run command line, hr=0x80070002 InstallSoftware 16.05.2012 16:13:59 1040 (0x0410)

Process completed with exit code 2147942402 TSManager 16.05.2012 16:13:59 3760 (0x0EB0)

!--------------------------------------------------------------------------------------------! TSManager 16.05.2012 16:13:59 3760 (0x0EB0)

Failed to run the action: Windows Activation.

The system cannot find the file specified. (Error: 80070002; Source: Windows) TSManager 16.05.2012 16:13:59 3760 (0x0EB0)

Share this post


Link to post
Share on other sites

Seems like you have created the activateWindows.bat.txt with notepad and forgot to remove the ".txt" extension.

 

 

Downloaded file from http://HEG-36.ge-em....Windows.bat.txt to C:\_SMSTaskSequence\Packages\HEG00014\activateWindows.bat.txt InstallSoftware 16.05.2012 16:13:58 1040 (0x0410)

Failed to execute command line '.\activateWindows.bat' .

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
Reply to this topic...

×   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.