Task Sequence failing to create a file

Santhosh B S 106 Reputation points
2024-01-23T13:40:12.51+00:00

Team, I have a package with below details and I added that package in Task sequence to create a file called ABCD.log \
mkdir c:\temp echo ABCD ran > c:\temp\ABCD.log echo off exit \
in the task sequence > command line I mentioned cmd /c ABCD.cmd When i run manually its working. Please help

Microsoft System Center Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AlexZhu-MSFT 6,591 Reputation points Moderator
    2024-01-24T01:48:47.4366667+00:00

    Hi,

    If we use package, there is no need to add the "cmd /c", like below example:

    image-192

    Alternatively, if we don't want to use a package, we can use either of the following:

    1, run the .cmd or .bat from UNC path (make sure you authenticate first), see below sample picture

    2, write the command in the "Command line" textbox directly as below:

    cmd /c "mkdir c:\temp" & cmd /c "echo ABCD ran > c:\temp\ABCD.log"

    sccm-run-scripts-before-format-1

    mkdir c:\temp
    echo ABCD ran > c:\temp\ABCD.log
    echo off
    exit
    

    Regards,

    Alex


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.