1
    @echo off


::
:: Grabbing the users input of job number to create
:: 
SET /P JobNum="Enter Job Number: "


::
:: Creating the job number folder structure
::
MKDIR "\\server\jobs\%JobNum%"
MKDIR "\\server\jobs\%JobNum%\DataPrep"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Data"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Data\Input"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Data\Working"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Programs"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Docs"
MKDIR "\\server\jobs\%JobNum%\Prepress"
MKDIR "\\server\jobs\%JobNum%\Prepress\Working"
MKDIR "\\server\jobs\%JobNum%\Prepress\PNetImages"
MKDIR "\\server\jobs\%JobNum%\CSR"
MKDIR "\\server\jobs\%JobNum%\Production"
MKDIR "\\server\jobs\%JobNum%\Production\MailDocs"
MKDIR "\\server\jobs\%JobNum%\Production\Output"

Need this converted to PS script. Not sure about the PS commands and how they translate from a batch file.

1 Answer 1

1

Try something like this:

$JobNum = Read-Host -Prompt "Enter Job Number: "
("",
"\DataPrep",
"\DataPrep\Data",
"\DataPrep\Data\Input",
"\DataPrep\Data\Working",
"\DataPrep\Programs",
"\DataPrep\Docs",
"\Prepress",
"\Prepress\Working",
"\Prepress\PNetImages",
"\CSR",
"\Production",
"\Production\MailDocs",
"\Production\Output") |
foreach-object { new-item -type directory -path "\server\jobs\$JobNum$_" }

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.