Sunday, March 24, 2019

Customize Find in Files Find Results format of results

So Im using VS 2017, find in files, the Find Results is displaying an awful long result for each file name found as the result of a search. This makes it difficult to quickly ascertain the fie name. Previous versions of VS by default displayed the file name, it seems (for me atleast) that VS 2017 is displaying the Full name in Find Results. See example here





To resolve we would like to view FileName or relative full name in the Find Results.
To do this, we need to implement a per version solution for VS:

>= VS 2017

  • Close Visual Studio 2017
  • Open regedit
  • Open bin file:
"C:\Users\[userName]\AppData\Local\Microsoft\VisualStudio\15.0_f294cc8e\privateregistry.bin"
  • Select HKEY_LOCAL_MACHINE from the left bar
  • Select File > Load Hive...
  • Load the privateregistry.bin file from %localappdata%\Microsoft\VisualStudio\15.0_[instanceid]{RootSuffix}\privateregistry.bin. The RootSuffix for a normal VS installation will be blank. This is mostly used for the experimental instance
  • Name the key whatever you want (e.g. "VS2017") when prompted
  • From there, you should be able to view the entries just like any normal registry.
  • Customize it according to accepted answer's suggestions.
  • Once you're finished, you need to make sure that you "Unload" the private registry, by selecting the "root" key ("VS2017" in this example) and selecting File > Unload Hive . If you don't do this, VS won't be able to read the privateregistry.bin file when it runs, causing major problems
< VS 2017
Using regedit:
See article Customize how Find in Files results are displayed in the Find Results Window:
Example here


Format specifiers:
Files
  • $p - path
  • $f - filename
  • $v - drive/unc share
  • $d - dir
  • $n - name
  • $e - .ext
Location
  • $l - line
  • $c - col
  • $x - end col if on first line, else end of first line
  • $L - span end line
  • $C - span end col
Text
  • $0 - matched text
  • $t - text of first line
  • $s - summary of hit
  • $T - text of spanned lines
Char
  • \n - newline
  • \s - space
  • \t - tab
  • \\ - slash
  • \$ - $

IE 11 and SharePoint Detect Compatibility Mode

Strange but true:

Identifying compatibility view in IE11 without the use of Developer tools (F12)

It’s possible to parse used IE version and its mode from User Agent string. And you don’t even have to do that yourself: there’s actually a small JavaScript-library called IE-truth, that does this for you. You can find it here: https://github.com/Gavin-Paolucci-Kleinow/ie-truth


Using this library, you can implement something like this in the script editor web part in SharePoint:

<span id="browserVersion"></span>
<script src="//cdn.rawgit.com/Gavin-Paolucci-Kleinow/ie-truth/master/ie-truth.js" type="text/javascript"></script>   <script type="text/javascript">// < ![CDATA[
// < ![CDATA[
var IE = IeVersion();
var elem = document.getElementById("browserVersion");
elem.innerHTML = "Is your browser using compatibility mode: " + IE.CompatibilityMode;
// ]]>
</script>

Full Source of source script as of 201903:

function IeVersion() {
    //Set defaults
    var value = {
		IsIE: false,
		IsEdge: false,
		EdgeHtmlVersion: 0,
		TrueVersion: 0,
		ActingVersion: 0,
		CompatibilityMode: false
	};   //Try to find the Trident version number
	var trident = navigator.userAgent.match(/Trident\/(\d+)/);
	if (trident) {
		value.IsIE = true;
		//Convert from the Trident version number to the IE version number
		value.TrueVersion = parseInt(trident[1], 10) + 4;
	}   //Try to find the MSIE number
	var msie = navigator.userAgent.match(/MSIE (\d+)/);
	if (msie) {
	    value.IsIE = true;
        	//Find the IE version number from the user agent string
		value.ActingVersion = parseInt(msie[1]);
	} else {
		//Must be IE 11 in "edge" mode
		value.ActingVersion = value.TrueVersion;
	}   //If we have both a Trident and MSIE version number, see if they're different
	if (value.IsIE &amp;&amp; value.TrueVersion &gt; 0 &amp;&amp; value.ActingVersion &gt; 0) {
		//In compatibility mode if the trident number doesn't match up with the MSIE number
		value.CompatibilityMode = value.TrueVersion != value.ActingVersion;
	}   //Try to find Edge and the EdgeHTML vesion number
	var edge = navigator.userAgent.match(/Edge\/(\d+\.\d+)$/);
	if (edge)
	{
		value.IsEdge = true;
		value.EdgeHtmlVersion = edge[1];
	}
	return value;
}

Friday, March 15, 2019

Delete Directory Results in error File Path is “is too long.”

We receive the below error when runing a rmdir or manual delete:




Workaround #1:
Download 7Zip:
  1. Download and install the latest stable build of 7zip.
  2. Run the 7zip File Manager (7zfm.exe).
  3. In the 7zip File Manager, navigate so that you can see the name of the folder you want to delete (i.e. you're in the parent folder).
  4. Hold the Shift button down.
  5. Click the "Delete" button, either on your keyboard or in the 7zip File Manager toolbar; make sure you're still holding the Shift key down.
  6. Click the "OK" button; make sure you're still holding the Shift key down.


Workaround #2:
Download FastCopy:
Use the Delete function:



Tuesday, March 12, 2019

Windows 10 Power Management Tab is missing and Bluetooth

IF you have issues with a bluetooth mouse or keyboard dropping connection or does not connect when computer awakes / reboots, then the below info will assist. When this issue occurs, most white papers direct us to update the Power Management tab for Bluetooth drivers associated with the peripheral. However starting somewhere around build 1700 or 1800 of Win 10 the Power Management tab is missing from the driver prop tabs. Thus we need a reg hack to bring back the Power Management tab;  Now we can adjust the Power Management  settings associated with the specific BT driver for the peripheral, in my case a Logitech Ultra Thin Mouse

View Power Management Tab in device manager when it is (hidden) See below:

Image

1) create a reg key and set value to 0

Open RegEdit and move to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power

If it's not created : create new DWORD key,  name = CsEnabled , value= 0.

Restart the machine, now check the driver. To view a driver for a specific peripheral the below screenshot show step by step :