If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair. $ gpg -full-generate-key; If you are not on version 2.1.17 or greater, the gpg -full-generate-key command doesn't work. Paste the text below and skip to step 6. $ gpg -default-new-key-algo rsa4096 -gen-key. How to Use Slmgr to Change, Remove, or Extend Your Windows License Chris Hoffman @chrisbhoffman Updated July 3, 2017, 9:14pm EDT Windows activation is designed to be as foolproof as possible, so Microsoft’s graphical tools keep it simple.

If you need to add a registry entry to a Windows PC most often techs will simply export the key and entries they want and then use the REGEDIT /S command to push that entry onto another PC.

For example if you want to disable the Cortana bar (but not Windows Search), you save the following into a file named DISABLE-CORTANA.REG

Use the ssh-keygen command to generate SSH public and private key files. By default, these files are created in the /.ssh directory. You can specify a different location, and an optional password (passphrase) to access the private key file. If an SSH key pair with the same name exists in the given location, those files are overwritten. Sign your app from command line. You do not need Android Studio to sign your app. You can sign your app from the command line, using apksigner for APKs or jarsigner for app bundles, or configure Gradle to sign it for you during the build. Either way, you need to first generate a private key.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindowsWindows Search]
'AllowCortana'=dword:00000000

Then you simply put that file on one of your servers and push it out to your PC’s using something like:

regedit /s '<Your-Server><Your-Share>Scriptsdisable-cortana.reg'

HOW TO ADD A REGISTRY KEY USING COMMAND LINE SCRIPT:

However, if you have a simple registry change you want to make you can avoid the .REG file and simply use REG ADD command to make your change. For instance:

reg add 'HKLMSOFTWAREPoliciesMicrosoftWindowsWindows Search' /v AllowCortana /t REG_DWORD /d 1 /f

The switches mean:

/v <ValueName>Specifies the name of the registry entry to be added under the specified subkey.
/veSpecifies that the registry entry that is added to the registry has a null value.
/t <Type>Specifies the type for the registry entry. Type must be one of the following:
REG_SZ
REG_MULTI_SZ
REG_DWORD_BIG_ENDIAN
REG_DWORD
REG_BINARY
REG_DWORD_LITTLE_ENDIAN
REG_LINK
REG_FULL_RESOURCE_DESCRIPTOR
REG_EXPAND_SZ
/s <Separator>Specifies the character to be used to separate multiple instances of data when the REG_MULTI_SZ data type is specified and more than one entry needs to be listed. If not specified, the default separator is 0.
/d <Data>Specifies the data for the new registry entry.
/fAdds the registry entry without prompting for confirmation.
Here are some more examples you may find useful:
  • REG ADD HKCUSoftwareSS64 /v Sample /d 'some test data'
  • reg add HKEY_CURRENT_USEREnvironment /v userpath /t REG_EXPAND_SZ /d C:Windows
  • REG ADD HKLMSoftwareMyCo /v Data /t REG_BINARY /d fe340ea
  • reg add HKLMSoftwaresav /v test /t REG_SZ /d '%userprofile%'

HOW TO DELETE A REGISTRY KEY USING COMMAND LINE SCRIPT:

Deleting a registry key using command line is simple, using the syntax:
Reg delete <KeyName> [{/v ValueName /ve /va}] [/f]
<KeyName>Specifies the full path of the subkey or entry to be deleted. To specify a remote computer, include the computer name (in the format ComputerName) as part of the KeyName. Omitting ComputerName causes the operation to default to the local computer. The KeyName must include a valid root key. Valid root keys for the local computer are: HKLM, HKCU, HKCR, HKU, and HKCC. If a remote computer is specified, valid root keys are: HKLM and HKU.
/v <ValueName>Deletes a specific entry under the subkey. If no entry is specified, then all entries and subkeys under the subkey will be deleted.
/veSpecifies that only entries that have no value will be deleted.
/vaDeletes all entries under the specified subkey. Subkeys under the specified subkey are not deleted.
/fDeletes the existing registry subkey or entry without asking for confirmation.
For example:
reg delete 'HKLMSOFTWAREPoliciesMicrosoftWindowsWindows Search' /f

DETAILS ON ALL THE REG COMMANDS:

Here are all of the REG commands in Windows 10, with links to their respective Microsoft support pages:

While Encrypting a File with a Password from the Command Line using OpenSSLis very useful in its own right, the real power of the OpenSSL library is itsability to support the use of public key cryptograph for encrypting orvalidating data in an unattended manner (where the password is not required toencrypt) is done with public keys.

The Commands to Run

Generate a 2048 bit RSA Key

You can generate a public and private RSA key pair like this:

openssl genrsa -des3 -out private.pem 2048

That generates a 2048-bit RSA key pair, encrypts them with a password you provideand writes them to a file. You need to next extract the public key file. You willuse this, for instance, on your web server to encrypt content so that it canonly be read with the private key.

Export the RSA Public Key to a File

This is a command that is

openssl rsa -in private.pem -outform PEM -pubout -out public.pem

The -pubout flag is really important. Be sure to include it.

Next open the public.pem and ensure that it starts with-----BEGIN PUBLIC KEY-----. This is how you know that this file is thepublic key of the pair and not a private key.

To check the file from the command line you can use the less command, like this:

Command Line To Generate A New Key In Excel

less public.pem

Do Not Run This, it Exports the Private Key

A previous version of the post gave this example in error.

openssl rsa -in private.pem -out private_unencrypted.pem -outform PEM

The error is that the -pubout was dropped from the end of the command.That changes the meaning of the command from that of exporting the public keyto exporting the private key outside of its encrypted wrapper. Inspecting theoutput file, in this case private_unencrypted.pem clearly shows that the keyis a RSA private key as it starts with -----BEGIN RSA PRIVATE KEY-----.

Visually Inspect Your Key Files

It is important to visually inspect you private and public key files to makesure that they are what you expect. OpenSSL will clearly explain the nature ofthe key block with a -----BEGIN RSA PRIVATE KEY----- or -----BEGIN PUBLIC KEY-----.

You can use less to inspect each of your two files in turn:

Command Line To Generate A New Key
  • less private.pem to verify that it starts with a -----BEGIN RSA PRIVATE KEY-----
  • less public.pem to verify that it starts with a -----BEGIN PUBLIC KEY-----

The next section shows a full example of what each key file should look like.

The Generated Key Files

The generated files are base64-encoded encryption keys in plain text format.If you select a password for your private key, its file will be encrypted withyour password. Be sure to remember this password or the key pair becomes useless.

The private.pem file looks something like this:

The public key, public.pem, file looks like:

Protecting Your Keys

Depending on the nature of the information you will protect, it’s important tokeep the private key backed up and secret. The public key can be distributedanywhere or embedded in your web application scripts, such as in your PHP,Ruby, or other scripts. Again, backup your keys!

Remember, if the key goes away the data encrypted to it is gone. Keeping aprinted copy of the key material in a sealed envelope in a bank safety depositbox is a good way to protect important keys against loss due to fire or harddrive failure.

Oh, and one last thing.

If you, dear reader, were planning any funny business with the private key that I have just published here. Know that they were made especially for this series of blog posts. I do not use them for anything else.

Found an issue?

Generate Command Stata

Rietta plans, develops, and maintains applications.

Learn more about our services or drop us your email and we'll e-mail you back.

New Windows Command Line

Other Blog Articles Published by Rietta.com