Jump to content


  • 0
sysadmin101

Command Line & Environment Variable Woes

Question

Hi,

 

I have a task sequence that installs Windows 7 from the original .wim file and then applies a language pack and finally installs some applications and updates.

I included in the task sequence, some command line commands.

 

As I did not want to have to create a batch file and distribute it, I combined the multiple commands into a one-liner.

For example, changing the power options:

post-23786-0-21636300-1396587230_thumb.png

 

Essentially, the multiple commands are combined into a one-liner using the ampersand '&'

I made sure to test the command lines on a Windows machine to make sure they are valid commands - which they are.

 

However, the task sequence does not seem to run them at all.

I have other command lines in the same task sequence (single command) - they all run perfectly.

Why is it the one-liner multi-commands don't run? Does SCCM TS not support '&'?

 

 

Another strange thing I have noticed is that after the OS is deployed with SCCM and I log in using my domain account, the environment variables all do not work (I checked System properties - they are all there).

But if I open command prompt, and type 'powershell' or 'taskmgr' for example, it tells me '*****' is not recognized as an internal or external command, operable program or batch file.

Does anyone know why this happens and how can I fix it?

Thank you.

post-23786-0-21636300-1396587230_thumb.png

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello,

 

I've seen this exact same behavior during my Task Sequences with the same '&' sign in it. You could also create a package with all the commands in a .cmd/batch file. And then just run that package during your Task Sequence. I tried the exact same powercfg configurations during the Task Sequence, but it didn't work out.

 

You can also set Power Settings in the Device Collections, just right click on them and go to Power Managment.

PowerMgmt.png

 

Kind Regards,

Kevin

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.