Showing posts with label windows 7. Show all posts
Showing posts with label windows 7. Show all posts

Saturday, December 20, 2014

Windows 7 and Windows 8 Basics: Searching by File Size, Modification Date and Other File Properties

It was one of these days, not long ago, that I work up one day and realized that I had become an Old Man. Mine is the last generation that remembers a time prior to the internet. I remember using acoustic couplers. My first laptop, a Toshiba, had dual 5 1/2 inch floppy drives, but had no hard drive. I was so excited when I got my hands on that machine. It meant I could connect to networks using my acoustic coupler from a pay phone!

My ruminations on aging is at least somewhat related to the topic at hand. You see, among the memories rattling around my grey hair ensconced head are a few about searching Windows file systems for files of specific types. This sort of thing is very important, even just for every day normal computer usage.

When your computer starts running out of space, wouldn't it be nice to be able to find all of the really large files on that computer? Or perhaps you are looking for an important document you wrote - you can't remember the name of the file but you remember the week that you wrote it. Doing this in Windows XP is straight-forward, because the Windows XP search box (what Microsoft calls the "Search Companion") includes these more advanced functions, and accessing that search box is as simple as clicking the Start button and clicking Search from the resulting contextual menu. Such a search box typically looks similar to this:

Windows XP, Josh Wieder, search, dog
As you can see selecting size and date modification are simple in this format. However, Microsoft, in their infinite wisdom, decided to abandon this simple and straight forward menu, replacing it with a single magnifying glass icon without any options whatsoever:

Windows 7, Josh Wieder, Search bar
Searching mad stupid.
Without the simple and easy to use Search Companion, how are we supposed to look for files based on their properties instead of their name?

The answer, unfortunately for users only accustomed to graphical interfaces, is a series of command line arguments.

Here is a list of such the available search commands for Windows 7 and Windows 8, taken from the relevant Microsoft KB article:

Example search termUse this to find
Files whose names begin with "notes." The ~< means "begins with."
System.FileName:="quarterly report"
Files named "quarterly report." The = means "matches exactly."
Files whose names contain the word "pro" or the characters pro as part of another word (such as "process" or "procedure"). The ~= means "contains."
Files that aren't pictures. The <> means "is not."
Files that were modified on that date. You can also type "System.DateModified:2010" to find files changed at any time during that year.
Files whose authors don't have "herb" in their name. The ~! means "doesn't contain."
Files that are tagged with the word sunset.
Files that are less than 1 MB in size.
Files that are more than 1 MB in size.

In addition to these commands, users can also use a series of Boolean command line operators to further refine searches:

OperatorExampleUse this to
tropical AND island
Find files that contain both of the words "tropical" and "island" (even if those words are in different places in the file). In the case of a simple text search, this gives the same results as typing "tropical island."
tropical NOT island
Find files that contain the word "tropical," but not "island."
tropical OR island
Find files that contain either of the words "tropical" or "island."

Although the commands themselves are non-intuitive, using them is straight-forward. Simply type the appropriate command into the Windows search box, either in the Start menu or in the top-right corner of a File Manager menu. Here is an example, where we have searched for all files larger than 100MB in size in the drive C:\

Windows 7, Josh Wieder, search terms
A search example in Windows 7
There are a variety of circumstances where Windows' search implementation will fail to meet a user's needs. First and foremost, the search function is resource intensive, inaccurate and slow. Compared to Linux's `grep`, `find` and `locate` commands, Windows Search is almost laughably bad, particularly when attempting to search for strings inside of files.

There are other tools available for Windows that vastly improve on the default Windows search function. My recommendation at this time is GrepWin built by Stefan Kiing, available for download at the Google Code site.

GrepWin allows users to search by simple strings, operators and terms like those we described above, providing faster more accurate responses than those available from Windows' default search. In addition to basic search functionality, GrepWin also accepts regular expressions as input. While cryptic, and with a steep initial learning curve, regular expressions are incredibly powerful and a fundamental part of modern computer programming. With regular expressions, you may find specific and complex patterns from large datasets efficiently and quickly. We will almost certainly explore regular expressions in depth with their own post (or perhaps series of posts).

Thats it for now on Windows-based searching. When we return to searching in the future, we will likely spend more time on searching databases, arrays and other data structures as well as providing more theoretical explanations for file system search.

Thursday, November 13, 2014

I Ran Windows 7 Updates and My Desktop Went Completely Black! What Do I Do?!

So last night (11-12-14) or this morning you ran a package of `Important` Windows Cumulative Security Updates. Gee those do sound important! There were about 11 or so - specifically, the ones most likely to give you trouble are these:

Update for Windows 7 for x64-based Systems (KB3008627)
Security Update for Windows 7 for x64-based Systems (KB3003743)
Security Update for Windows 7 for x64-based Systems (KB2993958)
Security Update for Windows 7 for x64-based Systems (KB2991963)
Security Update for Windows 7 for x64-based Systems (KB3005607)
Security Update for Windows 7 for x64-based Systems (KB2992611)
Security Update for Windows 7 for x64-based Systems (KB3010788)
Security Update for Windows 7 for x64-based Systems (KB3002885)
Security Update for Windows 7 for x64-based Systems (KB3006226)

After diligently downloading and installing these updates, you allow your computer to reboot. The boot process goes smoothly, you log into your computer, only to find a stark black screen greeting you. Your entire intricately-designed array of desktop icons is gone. Your Desktop Image is replaced by an inky black nothing. Worse even than the blackness of space - even space has stars.

The frank obituary to your beautiful desktop's demise is the following: 

C:\windows\system32\config\systemprofile\Desktop refers to a location that is unavailable. It could be on a hard drive on this computer or on a network. Check to to make sure the disk is properly inserted.

And its' not just the icons or the desktop. Trying to search for an item from the Start menu will produce an error along these lines (where searchstring is whatever you typed in the taskbar): 

"Windows cannot find `search:query=searchstring` Make sure you typed the name correctly, and then try again." 

Microsoft's Mouse and Keyboard Center failed to load completely; despite this, my laptop's USB mouse and embedded touch pad functioned properly.

Even non-Windows related applications will have problems. When I encountered this error, I had to launch Google Chrome as an Administrator in order to get it to run. I also use an incredibly handy text editor in Windows called Notepad++. Notepad++ is an ingeniously formatted gem of a Windows text editor; it can open text files that are sized well into the tens of megabytes without crashing, it color encodes scripted text for programming; its awesome. Use it; its free. Anyway, launching Notepad++ also produced errors; the application was unable to find a variety of XML configuration files.

We've established that this problem sucks. So how do we fix it?

First, you may have problems opening a Command Prompt due to the `search:query` error mentioned above. If you have Powershell installed, use that - it will save time and headaches and can function exactly as a normal command prompt would. If installed you can typically find Powershell in the Start Menu by navigating to All Programs -> Accessories -> Windows Powershell

If you do not have Powershell installed you will have to suffer through by opening a window from `My Computer` by navigating through the Start Menu: click Start and then Computer. It is likely that each time you open a window in this manner a new error message will be produced telling you that your systemprofile\Desktop is missing. You can ignore the error, clicking OK to remove it and proceed.

From here on we will be using in example in which the username we are using is Josh. On your computer you will of course replace Josh with your own username.

Either way you use (powershell of window), navigate to the User directory, which for the purposes of this tutorial will be C:\Users\Josh

We are here to check first and foremost that your actual Desktop folder and files still exists. Click or `cd` to the Desktop folder and take a quick look to ensure that everything still exists. If it does, proceed with the tutorial. If your Desktop folder is missing, than stop here - the issue I am describing should not have caused the entire deletion of your Desktop. You will need to restore these files from backup before continuing to troubleshoot; I hope you kept a backup!

Anyway, for those of us who found that C:\Users\Josh\Desktop exists and is populated with files, we will then navigate to the root of the problem: C:\windows\system32\config\systemprofile\

In this directory you are likely to find three items: Two folders, one named "AppData" and the other named "Contacts". The third item will likely be ntuser.dat - although it may be missing if your Windows folder settings are configured to "hide protected operating system files".

FYI don't be a wimp - BE A POWER USER and go to Organize -> Folder and Search Options -> View tab. From there UNclick "Hide protected operating system files" and select the radio button next to "Show hidden files, folders, and drives". Once you have done this you will notice that a new universe of system files is now available for your perusal. I offer less experienced users this tidbit with the explicit promise that they will refrain from two things:

        1. DO NOT Delete Files Because You "Don't Know What They Do".
             Only Delete Files That You Fully Understand.
        2. When You Encounter an Esoteric File DO NOT Search the Name of That File in Google. 
             All of the Websites in Google Will Tell you it is a Virus and Compel You to Purchase Their
             Magical Program to Remove Said Virus. To Understand System Files, You Must RTFM and
             Other Actual Books. Like From a Library Books.

Anyway back to the fix. Within the directory C:\windows\system32\config\systemprofile\  you must create a new directory (by right-clicking and selecting New -> Folder or issuing the command mkdir in PowerShell) and name it "Desktop".

Immediately after creating this directory you may notice that some icons have appeared on the black-as-death desktop. However, these won't include your normal icons, and your desktop image as well as any items you have stuck to the taskbar will not have reappeared. Thats okay - right now you are relying on a broken copy of the "Public" Desktop, and the appearance of icons is a signal that the Public profile is getting better.

To finally get all of your profile settings back, along with the precious icons and desktop doo-dads, simply goto Start, hover your mouse over the arrow next to "shut down" (not shut down, just the arrow) and click "Log off" from the resulting contextual menu.

You will be prompted to Log back into your account. Do so, and you will find that everything in your desktop is back to normal. Enjoy!

Sunday, November 25, 2012

List of Windows Activation Keys for KMS

Includes Keys for Windows Server 2012, Windows Server 2008, Windows 8, Windows 7 and Vista

This list of keys for KMS can be a real hassle to find in Microsoft's online documentation, so provided here in the hopes of saving you some time. Please note that these are not stolen product keys and as such publishing them is a time saver for administrators managing large deployments of fully licensed Microsoft products  - so if you are a thief or an Internet police person, sorry to disappoint but you've made it to the wrong site.


Windows Server 2012 Core

Windows Server 2012 Core N

Windows Server 2012 Core Single Language

Windows Server 2012 Core Country Specific

Windows Server 2012 Server Standard

Windows Server 2012 Standard Core

Windows Server 2012 MultiPoint Standard

Windows Server 2012 MultiPoint Premium

Windows Server 2012 Datacenter

Windows Server 2012 Datacenter Core


Windows 8 Professional

Windows 8 Professional N

Windows 8 Enterprise

Windows 8 Enterprise N


Windows Server 2008 R2 HPC Edition

Windows Server 2008 R2 Datacenter

Windows Server 2008 R2 Enterprise

Windows Server 2008 R2 for Itanium-Based Systems

Windows Server 2008 R2 Standard

Windows Web Server 2008 R2

Windows Server 2008 Datacenter

Windows Server 2008 Datacenter without Hyper-V

Windows Server 2008 for Itanium-Based Systems

Windows Server 2008 Enterprise

Windows Server 2008 Enterprise without Hyper-V

Windows Server 2008 Standard

Windows Server 2008 Standard without Hyper-V

Windows Web Server 2008


Windows 7 Professional

Windows 7 Professional N

Windows 7 Enterprise

Windows 7 Enterprise N

Windows 7 Enterprise E


Windows Vista Business

Windows Vista Business N

Windows Vista Enterprise

Windows Vista Enterprise N

Sunday, October 28, 2012

Changes to Windows Server 2012 Media Handling Reduce Bandwidth Requirements for Remote Desktop (RDP) and Terminal Services

RemoteFX Media Streaming Introduced

Over the years I have worked at both Internet Service Providers and server hosting companies. In both environments, customers have found thin client deployment and virtual desktop provisioning stymied by the bandwidth needs of remote desktop when used for day-to-day desktop computing style tasks. I can't remember how many times I have worked with a company whose entire network has failed or flapped because of employees downloading torrents or watching Youtube videos from a remote server. Other times, I have worked on Terminal Services capacity planning projects, and found myself impressed by the difficulty of giving reliable estimates even where good data is available.

Many companies have been completely unable to reap the rewards of hosted desktops (fast provisioning and restoring, centralized management, easy hardware replacement) because of the costs of reliable high-throughput internet connections to their office. Data center bandwidth isn't cheap, either. A number of companies have been founded (and a few, like Citrix, have flourished) around introducing appliances and applications to further compress the data on both ends of a remote desktop connection.

The rewards to the end user, then, of improving multimedia performance over RDP are huge. Microsoft is claiming to have done just that with Windows Server 2012.

Changes From Windows Server 2008 / Windows 7

Windows Multimedia Redirection (WMR) was the name for special multimedia handling in the last version of Windows. WMR had some positive innovations of its own - rendering takes place on the client side, and as a result, CPU load on the server is decreased. Under normal circumstances this is accomplished without a significant reduction in quality. There were a number of problems with the implementation - WMA, WMV, MP3 and DivX are handled, but unsupported protocols get handled without any special rendering (unsupported includes Flash, Silverlight and Quicktime - basically almost all video on the web). The client requires RDP 7.0 when connecting to take advantage of any of this. Bandwidth consumption is wholly dependent upon the bit rate of the original video. The frame rate sucks and becomes worse with scale.

Windows Server 2012 addresses the issues differently - WMR is replaced by RemoteFX. Through some secret mojo that has yet to be fully explained by Microsoft at this point, RemoteFX identifies regions of the screen that are to render video. The video content is encoded using H.264 codec and RemoteFX Progressive Codec. Audio is encoded by using the AAC codec. This is accomplished regardless of how the video is displayed - Silverlight, Flash - every protocol is supported. Because video behavior is consistent, capacity planning should become a more straightforward task, as the biggest variable for client resources finds a reduced range of possible values.

Microsoft is publishing some big claims on performance improvement. 90% bandwidth reduction claims should be greeted with skepticism, but other claims of frame rates over the WAN staying around 20 fps look promising. Testing demonstrates (I am working on embedding the video, should have it up shortly) that in a side-by-side comparison of Windows 7 and Windows 8 remote desktops using the same uplink - 2 Mbps throughput, 250ms round-trip latency, and 0.5% random loss - Windows 8 shows significant and noticeable graphical improvement, performing almost indistinguishably from a local display while playing the same Youtube video. Windows 7 struggles - several times a second, the video pauses to re-render a new image, making the display irritating and unwatchable. Keep in mind I have yet to test or see test results with multiple concurrent RDP connections, so at this point I would not recommend capacity planning using those numbers.

More testing is needed - what will be valuable is a greater understanding of the amount of resources (especially throughput) needed per RDP client, reliable maximum client per server numbers, and any additional provisos for virtual environments. If your projects are graphically intensive or involve unique image, audio or video handling, then running a few of your own stress tests is highly recommended.

When performing your own tests, note that WMR is still used for LAN connections in Windows Server 2012. Whether you are on a LAN or WAN is determined by latency - if your connection is under 30ms latency, WMR will be used. If your connection is over 30ms latency, RemoteFX is used. There are a lot of ways to control latency for testing - I am partial to NIST as Cisco's recommended WAN emulation software. Although NIST is Linux based, the previous link will take you to full installation media with detailed instructions (so you don't need to be an expert Linux administrator to get it working). That said, there are Windows-based WAN emulators too. Jperf (the java fork of iperf) and WANEM should do the trick, as well. Be sure to publish your results! Here is a link to the forums if after testing you would like to share your data with the community (I am also happy to publish your results here, or link to findings on your blog or website).

The tests so far I have seen look very promising - hopefully these changes continue to encourage the implementation of virtual desktops, as well as the adoption of Windows 8/2012 itself.

NSA Leak Bust Points to State Surveillance Deal with Printing Firms

Earlier this week a young government contractor named Reality Winner was accused by police of leaking an internal NSA document to news outle...