Running a command as Admin

Or how to run a command with elevated privileges on Windows.

Tried to run a chkdsk this morning via a Windows account that wasn’t in the Administrators group and found out that I couldn’t do so. This was when I chanced, by searching t’internet, upon the Control (Ctrl), Shift and Enter magic key combination, never heard of this! Using these keys, instead of just Enter, runs the selected command with Admin privileges, fab!

Exact filename searching on Windows 10

Trying to find a file by filename and file type and getting matches that include the filename and type as well? Windows 10 search seems to have taken a step backwards by being “helpful” in search file contents and filenames, or types, when you use the search box.

Then you need to use the “name” keyword in the quick search box. The name option has two ways of being used:

name: web.config” This does what you don’t want! i.e. it returns files that contain the words “web” and “config”, but it doesn’t return files that have file contents including those words.

name:= web.config” This command will return only matches for “web.config” nothing else.

Windows 10 restarts after shutdown

Currently have an issue where most of the time shutting down the PC just performs a restart, annoying to say the least, been going on since late 2018.
I’m currently trying out this solution to see if it can be resolved.

6-Dec-19: A couple of test shutdowns later and it seems to be working, one to monitor.

Remote Desktop: Map a local drive on the remote host

If you repeatedly use a Remote Desktop session and that session needs access to files on the machine you’re connecting from then you’d normally set up a network drive, possibly mapped as follows:

net use z: \\yourmachine\c$ /persistent:Yes

But, depending on how Draconian your network security is then mapping folders on user machines may actually be blocked. Strange one as this ability is mostly essential when working on a remote machine, especially if a developer. Fortunately you can map using the built in sharing of RDP. Same format as earlier just the machine name changes and effectively becomes a constant, so the mapping is now:

net use z: \\tsclient\c /persistent:Yes

And job done, until the next group policy is introduced blocking that…