Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Command Line in SCCM OSD

Posted on 2011-09-12
13
Medium Priority
?
5,017 Views
Last Modified: 2012-06-22
Hello,

I am having some challenges with applying some reg keys during OSD. I have a task sequence that uses a command line to run a cmd /c REG ADD .... and it does not run or at least it does not add the info to the registry.

Before that step, we use a cmd.exe /c NET LOCALGROUP to add a user to to localadmin and works. What could be preventing this from running?
0
Comment
Question by:teamfox201
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
  • +1
13 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 36527513
If this is durring OSD then why not just have it done on the base image?
0
 
LVL 31

Expert Comment

by:merowinger
ID: 36527566
Could you please post a screenshot from that "run command line" step in the task sequence
0
 
LVL 10

Expert Comment

by:Kezzi
ID: 36528203
Are you updating an existing key or amending one?
I use REG ADD command lines during my task sequence and they fail if the key already exists.  So I add a REG DELETE before that to remove the existing key then ADD it back with the new value.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 10

Expert Comment

by:Kezzi
ID: 36528205
Also, do you use the /f option to force it?
0
 

Author Comment

by:teamfox201
ID: 36528888
Neilsr:  The key values change based on a hta script that runs earlier.

Merowinger:  I am not in front of the comp right now but I know the command works because if I press F8 during the TS and manually type it in, it will work.

Kezzi:  Like the first user suggested the base image has the image version coded into the wim in HKLM\SOFTWARE\Comp Name and that's the only value that doesn't need to get written. I wonder if since the Comp Name key exits, the Reg add "hklm\software\comp name" /v "Owner " /t REG_SZ /d %owner% /f... The variables are passed from the hta script. I could try to delete the Comp Name then use reg add in the T'S. Will test this and report back.
0
 
LVL 31

Expert Comment

by:merowinger
ID: 36528935
x64 or x84 machine?
0
 

Author Comment

by:teamfox201
ID: 36528957
x86
0
 

Author Comment

by:teamfox201
ID: 36530139
Ok so I ran a reg delete in my TS and it does not remove that key. I even added a step to create a random HKLM\SOFTWARE\AA key but that was not created either. I don't get why this is not working. During this stage the OSD in not in WinPE but in the Current OS.

I attached a screenshot of one of the TS commands. REG ADD
0
 
LVL 10

Expert Comment

by:Kezzi
ID: 36530166
ok heres an idea.  maybe the variable isnt being parsed by the reg command.   so have you tried adding a key that does not consists of a %variable%?

if you use variables, i think it has to be a REG_EXPAND_SZ but then that might just write it as %variable% instead of what it parses as.
0
 

Author Comment

by:teamfox201
ID: 36530230
I just tried this one and it did not write either.

 random key
0
 
LVL 10

Assisted Solution

by:Kezzi
Kezzi earned 400 total points
ID: 36530236
you dont need to specify /t REG_SZ as by default its a REG_SZ unless otherwise specified

My command line is simpler than yours.  Mine is just:
REG ADD "HKLM\Software\Build" /v "Version" /d "Windows 7 1.2a" /f
and making sure the Start in: has C:\windows\system32
0
 

Accepted Solution

by:
teamfox201 earned 0 total points
ID: 36530976
OK I am back in business, apparently command prompt scripts in the TS need the Continue on error option checked since it probably does not send back a successful code if it executes.

I thank you all for your support!
0
 

Author Closing Comment

by:teamfox201
ID: 36558835
I figured out why my script was not running.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question