Skip to content

cmd script to set some registry settings

Featured Replies

Hi,

 

i build a package to deploy 7-zip. That works fine.

Now i want to define the file extensions that opens with 7-zip (they are not set by default und i didnt find any switch) with the following cmd script:

 

SET SC=HKLM\SOFTWARE\Classes

SET Extn=7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 gz-14 gzip-14 iso-8 lha-6 lzh-6 rar-3 rpm-10 split-9 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 wim-15 z-5 zip-1

FOR %%j IN (%Extn%) DO (

FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (

REG ADD %SC%\.%%A /VE /D "7-Zip.%%A" /F

REG ADD %SC%\7-Zip.%%A /VE /D "%%A Archive" /F

REG ADD %SC%\7-Zip.%%A\DefaultIcon /VE /D "%PROGRAMFILES%\7-Zip\7z.dll,%%B" /F

REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"%PROGRAMFILES%\7-Zip\7zFM.exe\" \"%%1\"" /F

)

)

 

The Script works in a normal cmd.

 

So ive created a new Programm in the 7-Zip package (commandline: config.cmd. After that, i added the new Programm to my TS.

But it always fails with the Error Code 0x800700FF

 

Whats wrong?

We can use PowerShell to translate the Win32 error code into a [more] useful description:

 

PS C:\Users\trevor.sullivan> [componentmodel.win32exception]0x800700FF

The extended attributes are inconsistent

 

http://learn-powershell.net/2011/06/28/quick-hits-translate-windows-error-codes/

 

Hmmmm, in this case, it's still a bit of a confusing error message. What extended attributes -- is it talking about file attributes? Probably not, since I'm not aware of any attribute "extensions" for the NTFS filesystem.

 

Here's one thing ... as a best practice, I always recommend that when building and testing packages or scripts in SCCM, before deploying it through SCCM, simply try running the command line as the Local System account. How do you do this? Download Sysinternals psexec, and use the -s parameter to invoke a command as Local System. This will help to ensure that your command still works even when SCCM executes it as Local System, rather than your user credentials.

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

  • 3 weeks later...

Have you tried this ?

 

SET SC=\\.\HKLM\SOFTWARE\Classes

 

Also define the type of the entries with /t switch.

  • 9 years later...

Error Code 255 ; what are the resolution steps.

i tried

1.sfc /scannow

2.Dism command

3.restart the machine

4. reinstalled sccm client

5. Gpupdate

Didn't work, please help me 

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.