Skip to content

Command Line & Environment Variable Woes

Featured Replies

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

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

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.