Skip to content

Task Sequence Command Line Delete Registry Error

Featured Replies

This is a little off topic from my last post, was wanted to start a new one.

 

I have some 64bit keys in the registry that need deleted, and it seems like since the SCCM client launches in 32bit mode it can't handle the call to a 64bit cmd during the script to delete the keys that I believe are 64bit keys.(i'm guessing these are 64 bit calls, I can't see any other reason why it won't delete these keys) The script deletes most of the keys except for these.

 

I tried running the following commands in a custom task sequence with *Disable 64-bit file system redirection" turned off without any luck. (there are multiple keys in the tree i'm trying to delete, do I need to delete each individual key instead of the tree?)

 

reg delete HKLM\SOFTWARE\TrendMicro /f

reg.exe delete HKLM\SOFTWARE\TrendMicro

cmd.exe /c reg delete HKLM\SOFTWARE\TrendMicro /f

 

I found the following for some 64 bit cmd call functions, but couldn't figure out how to make these work in windows much less sccm.

 

%windir%\syswow64\cmd.exe /c %windir%\sysnative\reg.exe

 

If I run a call to reg.exe and refer to a .reg file will this work? Not sure why this is giving me so much trouble.

 

 

Here are the Task Sequence Logs -

 

Set a global environment variable _SMSTSLogPath=C:\Windows\CCM\Logs\SMSTSLog TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
Expand a string: smsswd.exe /run: reg delete HKLM\SOFTWARE\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro_Volatile /f TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
Expand a string: TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
Start executing the command line: smsswd.exe /run: reg delete HKLM\SOFTWARE\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro_Volatile /f TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
!--------------------------------------------------------------------------------------------! TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
Expand a string: WinPEandFullOS TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
Executing command line: smsswd.exe /run: reg delete HKLM\SOFTWARE\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro_Volatile /f TSManager 9/27/2014 1:11:14 PM 5248 (0x1480)
[ smsswd.exe ] InstallSoftware 9/27/2014 1:11:14 PM 2944 (0x0B80)
PackageID = '' InstallSoftware 9/27/2014 1:11:14 PM 2944 (0x0B80)
BaseVar = '', ContinueOnError='' InstallSoftware 9/27/2014 1:11:14 PM 2944 (0x0B80)
ProgramName = 'reg delete HKLM\SOFTWARE\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro /f reg delete HKLM\SOFTWARE\Wow6432Node\TrendMicro_Volatile /f' InstallSoftware 9/27/2014 1:11:14 PM 2944 (0x0B80)
SwdAction = '0001' InstallSoftware 9/27/2014 1:11:14 PM 2944 (0x0B80)
Getting linked token InstallSoftware 9/27/2014 1:11:14 PM 2944 (0x0B80)
Working dir 'not set' InstallSoftware 9/27/2014 1:11:15 PM 2944 (0x0B80)
Executing command line: Run command line InstallSoftware 9/27/2014 1:11:15 PM 2944 (0x0B80)
Process completed with exit code 1 InstallSoftware 9/27/2014 1:11:15 PM 2944 (0x0B80)
ERROR: Invalid syntax. InstallSoftware 9/27/2014 1:11:15 PM 2944 (0x0B80)
Type "REG DELETE /?" for usage. InstallSoftware 9/27/2014 1:11:15 PM 2944 (0x0B80)
Command line returned 1 InstallSoftware 9/27/2014 1:11:15 PM 2944 (0x0B80)
Process completed with exit code 1 TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
!--------------------------------------------------------------------------------------------! TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Failed to run the action: Run Command Line.
Incorrect function. (Error: 00000001; Source: Windows) TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Set authenticator in transport TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Set a global environment variable _SMSTSLastActionRetCode=1 TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Clear local default environment TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Failed to run the action: Run Command Line. Execution has been aborted TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Set authenticator in transport TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Failed to run the last action: Run Command Line. Execution of task sequence failed.
Incorrect function. (Error: 00000001; Source: Windows) TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Set authenticator in transport TSManager 9/27/2014 1:11:15 PM 5248 (0x1480)
Task Sequence Engine failed! Code: enExecutionFail TSManager 9/27/2014 1:13:06 PM 5248 (0x1480)
**************************************************************************** TSManager 9/27/2014 1:13:06 PM 5248 (0x1480)
Task sequence execution failed with error code 80004005 TSManager 9/27/2014 1:13:06 PM 5248 (0x1480)
  • Author

I figured it out! I added this to my batch file and the batch file it calls on and it finally successfully removed trend. I need to do more testing, but I think it finally works.

 

@ECHO OFF
IF NOT "%PROCESSOR_ARCHITEW6432%"=="AMD64" GOTO native
ECHO "Re-launching Script in Native Command Processor..."
%SystemRoot%\Sysnative\cmd.exe /c %0 %*
EXIT
:native
ECHO "Running Script in Native Command Processor..."
REM Your script starts here

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.