The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for the ‘Windows’ Category

Some ICACLS & SubInACL.exe notes

Posted by jpluimers on 2015/03/31

Icacls.

The icacls tool is limited to files and directories, while subinacl managed services and registry as well.

For services (and registry?), you may want to try GPO:  http://support.microsoft.com/kb/256345

To script a solution, the best I could find in my search is to use Set-Acl: http://technet.microsoft.com/en-us/library/hh849810.aspx

via SubInACL.exe for Windows 7.

You will need to run ‘Subinacl Tool’ to reset the permission to normal. To reset system permissions, follow the steps:

1.       Download subinacl.msi from the following link, and save it on the desktop.

SubInACL

2.       On the desktop, double-click subinacl.msi to install the tool.

3.       Select C:WindowsSystem32 as the destination folder.

Note This step assumes that Windows is installed in C:Windows. If Windows is installed elsewhere, select the appropriate path to .System32.

4.       Open Notepad.

5.       Copy the following commands and then paste them into the opened Notepad window.

subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f

subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f

subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f

subinacl /subdirectories %SystemDrive% /grant=administrators=f

subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f

subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f

subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f

subinacl /subdirectories %SystemDrive% /grant=system=f

6.       In Notepad click File, Save As, and then type: reset.cmd

7.       In Notepad click Save as type, and then select All Files (.).

8.       Save the reset.cmdfile to your desktop, and close Notepad.

9.       Double-click the reset.cmdfile to reset the Windows Update permissions.

Note This step may take several minutes, so please be patient. When the permissions have been reset, you will be prompted with \”Finished, press any key to continue.\”

10.    Press any key to complete the installation.

Check if you have the right permissions to all the folders for all users.

For more information you may check the article given below. The article given is for Windows XP updates, but still holds good for Windows Vista as well as Windows 7.

http://support.microsoft.com/kb/968003

via How to reset all user permissions to default? – Microsoft Community.

Posted in Power User, Windows | 1 Comment »

On the research list; XP update failures

Posted by jpluimers on 2015/03/09

I know, I know. But the Olympus P-400 still requires XP.

So here it goes: failed updates.

Update for Microsoft Visual C++ 2012 Update 4 Redistributable Package ([Wayback] KB3032622)
Windows Malicious Software Removal Tool – February 2015 ([Wayback] KB890830)

The Microsoft web update fails to load at all with error [Wayback] 0x80248015, which is logical as officially there is not support any more.

http://www.update.microsoft.com/microsoftupdate/v6/default.aspx?ln=en-us

Luckily the Windows web update still works: http://windowsupdate.microsoft.com/windowsupdate/v6/default.aspx?ln=en-us

This time the update got simply resolved by rebooting. Hopefully that solved it for good.

–jeroen

Posted in Power User, Windows, Windows XP | Leave a Comment »

Interesting: CintaNotes note takeing tool; Windows only, but cloud possibilities and comes with good search

Posted by jpluimers on 2015/03/06

Need to put sime time in experimenting with CintaNotes – Wikipedia, the free encyclopedia: Interesting: CintaNotes note takeing tool; Windows only, but cloud possibilities and comes with good search.

–jeroen

Posted in Power User, Windows | Leave a Comment »

OpenSSL on Windows: fixing the “unable to write ‘random state'” (via: Stack Overflow)

Posted by jpluimers on 2015/03/05

If you are running OpenSSL as a regular user, or cannot perform “RunAs Administrator”, and you get this error message:

unable to write 'random state'

then make sure you have set your environment variables correctly before running OpenSSL:

RANDFILE=%LOCALAPPDATA%\.rnd

A full batch file front-end for OpenSSL.exe is this one:

Read the rest of this entry »

Posted in Batch-Files, Development, OpenSSL, Power User, Scripting, Security, Software Development, Windows | Leave a Comment »

Some command-line tips for OpenSSL and file format (pfx, p12, cer, crt, key, etc.) conversion of certificates, keys

Posted by jpluimers on 2015/02/27

OpenSSL is really nice, but remembering all these command-line switches is difficult, especially when you do not use them often enough.

I don’t, and when I do there are a few common tasks I perform, and I was glad to find a few links with great information:

I’ve converted them to batch files that run fine when copied to the directory where you put the x86 or x64 Windows version of OpenSSL (they assume %~dp0openssl.exe for the location of the OpenSSL.exe binary, just in case it is not on the path, or you have various tools that scattered around incompatible copies of OpenSSL binaries).

OpenSSL defaults to PEM format (that has text base64 strings), so if you get DER format (binary) you need to convert them.

A few errors I got and what they mean

Error decrypting PKCS#7 structure

Error decrypting PKCS#7 structure
5216:error:21070073:PKCS7 routines:PKCS7_dataDecode:no recipient matches certificate:.\crypto\pkcs7\pk7_doit.c:538:
5216:error:21072077:PKCS7 routines:PKCS7_decrypt:decrypt error:.\crypto\pkcs7\pk7_smime.c:557:

This error means that the recipient of the email does not match the certificate you pass in. What happens is that OpenSSL tries to decrypt the mail, it cannot match the certificate to the mail, and barfs. It usually happens when you have From/To reversed by accident.

Error decrypting PKCS#7 structure

Error decrypting PKCS#7 structure
4948:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:.\crypto\x509\x509_cmp.c:330:
4948:error:2107207F:PKCS7 routines:PKCS7_decrypt:private key does not match certificate:.\crypto\pkcs7\pk7_smime.c:552:

This means somewhere you mixed up a private and public key in the certificate files.

Use something like the OpenSSL wrapper verify-private-key-matches-certificate-x509-pem-cer.bat to verify them.

Error reading S/MIME message

Error reading S/MIME message
6900:error:0D06B08E:asn1 encoding routines:ASN1_D2I_READ_BIO:not enough data:.\crypto\asn1\a_d2i_fp.c:251:
6900:error:0D0D106E:asn1 encoding routines:B64_READ_ASN1:decode error:.\crypto\asn1\asn_mime.c:193:
6900:error:0D0D40CB:asn1 encoding routines:SMIME_read_ASN1:asn1 parse error:.\crypto\asn1\asn_mime.c:528:

OpenSSL does not like .EML files to end with a period (. which SMTP needs to process when sending an .EML file).
See https://gist.github.com/anonymous/7233372 and https://gist.github.com/anonymous/7233329
The former throws this error, the latter not. This is not caused the width of the base64 encoding (not yet archived at the WayBack machine), which I initially thought, but the terminating period.

Verification failure

Verification failure
8228:error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error:.\crypto\pkcs7\pk7_smime.c:342:Verify error:self signed certificate in certificate chai
n

–jeroen

Posted in base64, Development, Encoding, MIME, OpenSSL, Power User, Security, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

Installing the PIXMA mini260 – Canon Europe drivers under Windows 8.1 x64 – trying to say goodbye to Windows XP

Posted by jpluimers on 2015/02/23

Ditching Windows XP meant finding drivers for some older devices.

One of them is a [Archive.is] Canon PIXMA mini260 Photo Inkjet Printer which prints marvellous photos in a borderless way (so no post processing needed).

Installing drivers on Windows 8.1 x64 turned out to be really easy despite the fact that the Canon site does not offer them:  just install the “Windows Vista (64-bit)” drivers from this Canon link: [Wayback] PIXMA mini260 – Canon Europe.

This works as the printer driver model hasn’t changed much since Vista and the Vista drivers do not contain limits on future version numbers (see [Wayback] Getting older Windows drivers to work in Windows 8 for another example).

Now I need to find a way to get my [Archive.is] Olympus Camedia P-400 Digital Color Photo Printer. That is a lot harder: the most recent Windows P-400 Printer > Software Downloads are for Windows XP.

If anyone knows a workaround for this, I might connect this to an XP VM in a walled garden:

Under Windows XP, often the P-400 driver installer didn’t even want to install the USB part of the drivers.

How can I work around this?

Might it be that only the parallel LPTENUM is included in the [Wayback] Windows XP P400N.inf file, unlike the [Wayback] Windows 2000 driver P400N.INF file that contains both [Wayback] LPTENUM and [Wayback] USBPRINT and the [Wayback] P-440 INF file only has USBPRINT?

Other vendors seem to include both in their .INF files like this [Wayback] Dell 3130cn INF file.

–jeroen

via:

Posted in Power User, Vista, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Vista, Windows XP | Leave a Comment »

“PC Decrapifier” – via: Machines Plus Minds: Regarding Lenovo preinstalling SSL-breaking MITM on their machines

Posted by jpluimers on 2015/02/21

I didn’t even know there was a “PC Decrapifier”, but it exists: “PC Decrapifier” – Google Search.

Anyway: never use OEM Windows installs ever.

Would the Dutch Microsoft Store offer the same service?

–jeroen

via: Machines Plus Minds: Regarding Lenovo preinstalling SSL-breaking MITM on their machines.

Posted in Power User, Security, Windows | Leave a Comment »

Binary builds of Win64 and Win32 OpenSSL (via: Shining Light Productions)

Posted by jpluimers on 2015/02/20

The quickest way to get Win64 and Win32 binary builds of the youngest OpenSSL, you should get them from Shining Light Productions – Win32 OpenSSL.

Despite the link name, you can get the Win64 binaries from there too..

Besides binaries, they also have the source to build them from, and any other redistributable you’d need.

They run on virtually any Windows version, though I only used them on NT based Windows versions of XP/2003 and younger.

Two notes:

  • you usually need the Visual C++ 2008 redistributables, of which there is both an x86 and an x64 version (the OpenSSL installer just tells you it is missing, and assumes you know if it is the x86 or x64 one).
  • unless you are a software developer wanting to link to OpenSSL, the “Light” versions of the installs suffice.

–jeroen

via: Shining Light Productions – Win32 OpenSSL.

Posted in OpenSSL, Power User, Security, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | 1 Comment »

Creating an ICO file from multiple PNG files: IcoFX versus ConvertICO.org

Posted by jpluimers on 2015/02/17

For Windows Vista and up, you need at least these icon resolutions:

  • 16×16
  • 32×32
  • 48×48
  • 256×256

For Windows XP / 2003 Server and earlier, you’d only need the 16×16, 32×32 and 48×48 resolutions, and if you support older video hardware, include them in 24-bit, 8-bit and 4-bit color depth.

For younger versions you might consider adding 20×20, 24×24, 40×40, 64×64 and 128×128 as well to support higher DPI modes.

You need to include and various other sizes for other operating systems.

Getting at them, I usually start with an EPS file, then downscale to the right resolution, and save the resulting files as PNG images, then assemble those together.

A while ago, I had some icons with nice long diagonal line, then I found out the hard way I should not have used ConvertICO.org. I often prefer on-line tools over off-line, especially for actions I rarely do (this is one of them). It saves you from installing software, and on-line sites usually get better over time.

In this case, I shouldn’t have gone online: Just look at the jagged edges in the 200% zoom below: the image on the right is from ConvertICO.org, on the left it is from IcoFX.

What you clearly see is that ConvertICO messes around with the 256×256 image (it doesn’t mess around with the other resolution), but IcoFX doesn’t mess around.

So now I switched to IcoFX. Not on-line, but a great free tool. Read the rest of this entry »

Posted in Development, Power User, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | 2 Comments »

Windows Alt Key Codes

Posted by jpluimers on 2015/02/16

Brillant!: Windows Alt Key Codes.

The page has both lists of four-digit ALT+#### codes, a how-to, and reference links:

  1. Letters with Accents – (e.g. ó, ò, ñ)
  2. Other Foreign Characters – (e.g. ç, ¿, ß)
  3. Currency Symbols – (e.g. ¢, £, ¥)
  4. Math Symbols – (e.g. ±, °, ÷)
  5. Other Punctuation – (e.g. &, ©, §)
  6. Using the Codes
  7. Other Accents and Symbols: Character Map Other Page
  8. Non-Numeric Accent Codes: Activate International Keyboard Other Page
  9. Links to Other References

–jeroen

Posted in Development, Encoding, Power User, Software Development, Unicode, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »