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,862 other subscribers

Archive for the ‘Windows Server 2012’ Category

findstr as alternative for recursive grep search

Posted by jpluimers on 2016/04/27

Usually I use the old Borland grep.exe that still ships with Delphi. Too bad it is 16-bit app which does not recognise Unicode.

FindStr does. Though much slower and with limited regular expression capabilities, can do recursive searches too:

findstr /spin /c:"string to find" *.*

The /spin is a shortcut for these case insensitive command-line options (the full list of possible options is below):

  /S         Searches for matching files in the current directory and all
             subdirectories.
  /I         Specifies that the search is not to be case-sensitive.
  /N         Prints the line number before each line that matches.
  /P         Skip files with non-printable characters.

Sometimes I leave out the /P to include binary files.

–jeroen

via:

Read the rest of this entry »

Posted in Batch-Files, Development, Power User, RegEx, Scripting, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows NT, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista, Windows XP | Leave a Comment »

Improve Word performance with tables

Posted by jpluimers on 2016/03/25

Apart from the obvious “use less tables” and “break tables apart”, these can also help big time:

  1. Run %WinDir%\System32\SystemPropertiesPerformance.exe
  2. Choose “Ajust for best performance” (it will disable all visual enhancements)
  3. Re-enable “Smooth edges of screen fonts” (it will make it easier to set bold and italic apart in Word)

If it is still too slow, I might look into these:

–jeroen

Read the rest of this entry »

Posted in Microsoft Surface on Windows 7, Office, Office 2007, Office 2010, Office 2013, Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista, Word | Leave a Comment »

Figuring out Windows Registry Permissions: AccessCheck

Posted by jpluimers on 2016/01/06

I had to verify the rights on some parts of the registry were the same for a lot of machines. So I used AccessChk by SysInternals.

If there were difference, my plan was to use REGINI to fix them.

It appears that AccessCheck does not show the permissions for objects within the specified path, not for the path itself.

As I observed that

accesschk -k hklm\software\Microsoft\Windows\Shell

does not reveal results.

But

accesschk -k hklm\software\Microsoft\Windows

shows:

Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Leave a Comment »

Windows: Some links around SeBatchLogonRight (Logon as Batch job)

Posted by jpluimers on 2015/12/11

I will need this one day when doing some migration of jobs written as cmd scripts that are now ran occasionally by end-users into a scheduled fashion.

–jeroen

via: “Logon as batch job” script – Google Search

Posted in Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Leave a Comment »

Resolving “Unknown SSL protocol error in connection to bitbucket.org:443”

Posted by jpluimers on 2015/11/24

A while ago, I had this error on BitBucket:

Running git.exe with arguments "fetch --prune" failed with return code 128 and error output: "fatal: unable to access 'https://%account%@bitbucket.org/%user%/%repository%.git/': Unknown SSL protocol error in connection to bitbucket.org:443

A quick search for “Unknown SSL protocol error in connection to bitbucket.org:443” pointed me to a comment by Ludwik Trammer on an answer by Jordfräs:

I resolved the issue by upgrading from git 1.8 to git 2.0.

Which reminded me this was a Windows system, where there is no package manager that verifies how far your non-system software is behind.

One day, I will write a script that finds out about the git version history and inform me of major/minor versions I’ve skipped.

Some notes for that:

Probably I will need to do something similar for Mercurial/hg in the future as well.

–jeroen

via: git – Unknown SSL protocol error in connection – Stack Overflow

Posted in Development, DVCS - Distributed Version Control, git, Power User, Software Development, Source Code Management, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Leave a Comment »

Batch file to open a specific TCP port in Windows 7 / 2008 Server and up

Posted by jpluimers on 2015/09/18

Thanks to the answer by Kevin Richardson on How to open ports on Windows firewall through batch file, I wrote this batch file that uses the add command of the Netsh AdvFirewall Firewall Commands which requires Admin privileges to run:


:: open port (first argument passed to batch script, second argument is description)
:checkPrivileges
net file 1>nul 2>nul
if '%errorlevel%' == '0' ( goto :gotPrivileges ) else ( goto :getPrivileges )
:isNotAdmin
:getPrivileges
echo You need to be admin running with an elevated security token to run %0
goto :exit
:isAdmin
:gotPrivileges
netsh advfirewall firewall add rule name="Open Port %1 for %2" dir=in action=allow protocol=TCP localport=%1
:exit
::pause
exit /b

–jeroen

via: How to open ports on Windows firewall through batch file – Stack Overflow

Posted in Firewall, Infrastructure, Microsoft Surface on Windows 7, Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Leave a Comment »

Translating non-English error messages into English

Posted by jpluimers on 2015/08/06

For a long time, I’ve persuading people to install English versions of their operating systems (especially on server side) at least for some parts of their environment.

The main reason is that searching for English error messages gives you a much bigger chance of finding the cause than non-English ones.

I’m still standing by that recommendation, but life has become a bit easier because of these two sites that offer quite good translations of Windows Error messages in many languages to English:

I like the latter a bit more because of the overview, but the former more because of the catalog.

The way I landed there was because of a search for “Cannot SetData on a frozen OLE data object” which I bumped into for one of my C# .NET projects.

–jeroen

Posted in .NET, C#, Development, Power User, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista | Leave a Comment »

logparser – Wikipedia, the free encyclopedia

Posted by jpluimers on 2015/07/31

Thanks to Sebastian Gingter for pointing me at Logparser:

Logparser […] powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows operating system such as the Event Log, the Registry, the file system, and Active Directory. The results of the input query can be custom-formatted in text based output, or they can be persisted to more specialty targets like SQL, SYSLOG, or a chart.

Common use:

$ logparser [options] [SQL expression]

–jeroen

via logparser – Wikipedia, the free encyclopedia.

Posted in Development, IIS, Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2 | Leave a Comment »

Saving MMC files as MSC and prevent the “save console settings” dialog.

Posted by jpluimers on 2015/07/24

Two tricks when creating MSC files that contain the snap-in configuration of the MMC (Management Console).

Normally you do this once:

  1. Start MMC
  2. Add some snap-ins
  3. Save your configuration as an MSC file

And then when you need that particular configuration, each time:

  1. Open the MSC file
  2. Perform some actions
  3. Close the MMC
  4. Answer No to this question:

---------------------------
Microsoft Management Console
---------------------------
Save console settings to [filename].msc?
---------------------------
Yes No Cancel
---------------------------

The trick around this last question is:

Read the rest of this entry »

Posted in Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista, Windows XP | Leave a Comment »

Windows < 8: User variables are not resolved correctly in Windows if they contain %APPDATA% or %LOCALAPPDATA%.

Posted by jpluimers on 2015/07/13

Older Windows versions than 8.x will not correctly expand %APPDATA% or %LOCALAPPDATA% in environment variables: User variables are not resolved correctly in Windows..

This even happens when the registry storage of the environment variables are marked as REG_EXPAND_SZ under these keys:

Basically there are four categories of Windows versions:

  • For Windows 10.x this is fixed.
  • For Windows 8.x and Windows Server 2012 R2, there are updates in KB2919355.
  • For Windows 7.x and Windows Server 2008 R2, there is a hotfix.
  • For older Windows versions, there is no solution.

–jeroen

via: User variables are not resolved correctly in Windows.

Posted in Development, Power User, Software Development, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista | Leave a Comment »