Task Sequence -- Failed to run script via command line
Hi, i have the following problem with my task sequence. my intention is to run a script whcih is part of a package i created before. also part of the package is a script the first one calls. the whole package contains 2 files. First one is a cmd-file(opendiskpart.cmd) which runs diskpart and the second is a script(script.txt) which includes the commands diskpart should import. I tried to run a command line "cmd.exe /c opendiskpart.cmd" . but nothing happens, i think the client doesnt recieve any packages, so the command line cant call the mentioned script within the package. when i initiated the client to recieve new policies and packages the cache folder keeps empty. The reports i get dont reveal any helpfull information to me. The task sequence execution engine failed executing the action (Run Command Line) in the group ( ) with the error code 1 Action output: =======================[ smsswd.exe ] ======================= PackageID = 'BRD00019' BaseVar = '', ContinueOnError='' SwdAction = '0001' Getting linked token WinHttp credentials set failed to get the token information List of files to be downloaded Downloaded file from http://BRD-CFG1.BRD.NET:80/SMS_DP_SMSPKGC%24/BRD00019/diskpart.cmd to D:\_SMSTaskSequence\Packages\BRD00019\diskpart.cmd Downloaded file from http://BRD-CFG1.BRD.NET:80/SMS_DP_SMSPKGC%24/BRD00019/script.txt to D:\_SMSTaskSequence\Packages\BRD00019\script.txt Resolved source to 'D:\_SMSTaskSequence\Packages\BRD00019' Working dir 'D:\_SMSTaskSequence\Packages\BRD00019' Executing command line: Run command line Process completed with exit code 1 D:\_SMSTaskSequence\Packages\BRD00019>diskpart.exe 0<d:\script.txt ?????????????????????????†???????4Command line returned 1 The system cannot find the file specified.. The operating system reported error 1: Incorrect function. Finally i have 2 questions. 1. does a call for command-files or vbs-files via command line allways use the package i chose, or does it need any path? 2. how to create such a package correctly and how has the command line look like, to call a file from the package? Thanks in advance
November 29th, 2010 9:07am

You can use %~dp0 in .bat/-cmd file to get the directory where the script actually was started from. You don't have to prefix opendiskpart.cmd with "cmd /c". The batchfile should look like "diskpart /yourparameters %~dp0YourINIfile".
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 9:18am

i tried your suggestions, but after advertising the task sequence the status doesnt change from running action: run command line to failure or success. i think the client is looking for the package i selected. but the package isnt recieved by the client.
November 29th, 2010 10:08am

=======================[ smsswd.exe ] ======================= PackageID = 'BRD00019' BaseVar = '', ContinueOnError='' SwdAction = '0001' Getting linked token WinHttp credentials set failed to get the token information List of files to be downloaded Downloaded file from http://BRD-CFG1.BRD.NET:80/SMS_DP_SMSPKGC%24/BRD00019/diskpart.cmd to D:\_SMSTaskSequence\Packages\BRD00019\diskpart.cmd Downloaded file from http://BRD-CFG1.BRD.NET:80/SMS_DP_SMSPKGC%24/BRD00019/script.txt to D:\_SMSTaskSequence\Packages\BRD00019\script.txt Resolved source to 'D:\_SMSTaskSequence\Packages\BRD00019' Working dir 'D:\_SMSTaskSequence\Packages\BRD00019' Executing command line: Run command line Process completed with exit code 1 D:\_SMSTaskSequence\Packages\BRD00019>diskpart.exe 0<d:\script.txt ?????????????????????????†???????4Command line returned 1 The system cannot find the file specified.. The operating system reported error 1: Incorrect function. --------------------------------------------------------------------------------------------------------- It seems like the file diskpart.cmd was downloaded, but it is attempting to run diskpart.exe. Regards, Madan
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 10:45am

that was also my idea and renamed the files. but that wasnt the solution.
November 29th, 2010 11:03am

What does diskpart.cmd contain exactly?
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 11:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics