Enable Disk Cleanup Utility in Windows 2008 R2

To cleanup your disks from old files, service packs and tempory internet files Windows 7 has a tool called Disk Cleanup.

By default, this tool is not installed on Windows 2008 R2.
There are two ways to enable this:

  1. Install the “Desktop Experience” feature.
    This will install several Windows 7 features on your Windows 2008 R2 server such as Windows Media Player, Photo Management and the Disk Cleanup Utility.
    This is of course something you do not want installed on your server. Also, the server requires a reboot after installing the feature.
     
  2. Copy the files from the WINSXS directory.
    An easier way of enabling this the cleanup utility is to copy the files from the winsxs directory.
    You need two files: cleanmgr.exe and cleanmgr.exe.muiCopy cleanmgr.exe from  C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe to %systemroot%\System32
    Copy cleanmgr.exe.mui from C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui to %systemroot%\System32\en-US

There you go!

IGEL – How to configure a RDP or ICA Session that shuts down IGEL after session has ended

1. Setting up an RDP Session.
2. Setting up a “Locale Shell/Application” IGEL Setup -> Accessories -> Terminals.
3. Configuring in IGEL Setup -> System -> Registry ->  sessions -> xterm0 -> cmdline the following entry:
/config/sessions/winconnect0 ; /sbin/user_shutdown -f
4. From now on don´t start the RDP session, but the local Shell.
For some reasons it could be useful to change the Name and the Icon of the local Shell:
5. Change the Parameter “sessions.xterm0.Icon” to winconnect.
6. Change name of “sessions.xterm0.Session Name” to “RDP Session” or something like this.

To complete it, you should configure in Setup the RDP Session that this Session should not be added to the start menu or on the Desktop/Application Launcher.

Of course xterm0 or winconnect0 is changed to xterm1-…or winconnect1-…, if the Session is not the first session on the Thin Client.

For the autostart Go to IGEL Setup -> Accessories -> Terminals -> Local Terminal and turn on the Autostart Checkbox.

This works for an ICA Session too. Change every “winconnect0” in this FAQ to “ica0”

This works only on Linux based IGEL devices.

Network Adapter Priority Windows Server 2008 R2

What you do is go to Network and Sharing Center and click on the change adapter settings link. From there, if you have the Desktop Experience installed, you might not have the menu bar running across the top. You need to hit the Alt button on your keyboard in order to get the menu bar to show up. From the Advanced menu option, click Advanced Settings.

What will load is a funky little window with your adapters in the top part, and the bindings associated with the adapters on the bottom. For our purposes, you can ignore the bottom part of the window. We are only concerned with the top part.
In the top part you see all of your network adapters. You will also notice two arrows on the right of the selection window. What you are seeing is the adapter connection priority. The highest priority is on the top, running to the lowest priority on the bottom.
All that you need to do to set an adapter with a higher priority is to highlight the adapter, and click the up arrow. That’s it. Simple solution to a difficult problem.

Cleaning up the WINSXS folder in Windows 7 SP1

Earlier I wrote about the WINSXS directory in Windows Vista and Windows 2008.

In Windows 7 the cleanup tool is changed. Just like it changed with Service Pack 1 for Windows Vista en Windows 2008. 🙂

The new command is:
DISM /online /Cleanup-Image /SpSuperseded

Remember: This command requires elevated command prompt and you cannot uninstall the Service Pack after it completes!

UAC Virtualization – Allowing standard users to update a system protected area

You should know the score by now – I install application FOO into “C:\Program Files\Foo Inc\Foo” and it has a built-in manifest stating that asInvoker is used for its requested privilege level, allowing standard users to run it.

Attempts by standard users to write to “C:\Program Files\Foo Inc\Foo” do not fail with “access denied” (as they would have on version of Windows prior to Vista), but instead the disk write is redirected to the user’s own profiles (under “%userprofile%\AppData\Local\VirtualStore\Program Files”).

So far, so good – the application is happy as it believes it is able to write to a system protected area of the volume even when running without admin rights.

 

But imagine that FOO has an “automatic updater” or a “launcher” stub process whose job it is to check the current version of the application and download an update package & apply it…

The write operation is virtualized into the user’s profile, so the new patch will download okay – but when it comes to apply it this is also virtualized and the file it is updating or replacing is not in VirtualStore… so it fails.

Re-run the launcher and it will either start over with the download of the update, or try again to apply it and fail once more.

 

There are now plenty of apps (and games) that will run okay without admin privileges, but they have problems patching because of UAC virtualization unless the launcher was started elevated (or by the Administrator, who is the only user exempt from UAC as per my previous blog entry).

So how to leave UAC enabled and be able to use and update this program as a standard user?Continue reading

Setting primary monitor (dual monitors) on Ubuntu 10.10

I have my laptop connected to an external monitor, and I want the external monitor to be the primary display (i.e. with the menu bar displayed on it.) For some reason, there’s no GUI element to set this. I had to read a bunch of man pages, but when all else fails, trusty old xrandr to the rescue:

vijayp@ike:~$ xrandr --output HDMI1 --primary

In case you don’t know what your display is called, just run “xrandr” on its own. This is what my laptop says:

vijayp@ike:~$ xrandr
Screen 0: minimum 320 x 200, current 2880 x 1200, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
   1280x800       60.0*+
   1024x768       60.0
   800x600        60.3     56.2
   640x480        59.9
HDMI1 connected 1600x1200+1280+0 (normal left inverted right x axis y axis) 367mm x 275mm
   1600x1200      60.0*+
   1280x1024      75.0     60.0
   1152x864       75.0
   1024x768       75.1     60.0
   800x600        75.0     60.3
   640x480        75.0     60.0
   720x400        70.1
DP1 disconnected (normal left inverted right x axis y axis)

Android: Force Moving Apps to an SD Card

This isn’t anything new but I thought I would share my experiences of trying to free space on my HTC desire by forcing apps to be movable to the sd card using the android SDK on linux.

WARNING: Ensure you have a backup of any important data before you start in case something goes wrong. Carrying out these instructions is at your own risk.

Running out of space is really the only annoyance I have come across since owning an android phone. Every now and again the low space icon comes up and you have to try and free up some space.

Since Froyo you’ve been able to move certain apps to SD card, but it’s only if the developer allows it. If you’re an android developer and you want to know how to do it, see this post: Enabling the Android Move To SD Card Feature

So if you’re stuck with a bunch of apps you can’t move by default because “Move to SD Card” is greyed out in “Settings -> Applications -> Manage Applications -> Appname” then you might be thinking it’s not possible. However, it is possible to change the default install location to SD card via adb.

Introducing the Android Debug Bridge

Adb is the Android Debug Bridge which comes as part of the SDK. If you don’t have the SDK the first thing you will need to do is install it (get it fromdeveloper.android.com). Once you have the SDK you can find the adb tool in /platform-tools/, though in my case I have it at /tools/.

After you’ve installed the SDK you’ll need to connect your phone to your computer using the USB data cable. You’ll also need to make sure that debugging is possible by visiting “Settings -> Applications -> Development” and checking “USB Debugging”.

Enabling moving of apps to SD card

To change the the install location we are going to run the pm command via the adb shell. Here’s the details of the pm command:

The setInstallLocation command changes the default install location
  0 [auto]: Let system decide the best location
  1 [internal]: Install on internal device storage
  2 [external]: Install on external media

To change the default install location to the SD card (which also enables moving most apps to the SD card.) run the following from the dir containing the adb command:

./adb shell pm setInstallLocation 2

If you at any point hit the following:

error: insufficient permissions for device

Try doing this:

./adb kill-server
sudo ./adb  start-server

You should now find you can run the above commands without error.

Insufficient Storage Available

The other error I had was that when I was trying to move any app after changing the default install location to the SD card was something along the lines of “Unable to move application. Insufficient Storage”.

The way I got around this was to uninstall twitter which was using about 17mb (it was the largest app). After that I re-installed it and it used far less space (naturally as the data would have been removed by the re-install process). After that I was able to successfully move most of my remaining apps (twitter included) to my SD card.

Re-setting the installation location back to auto

I’d strongly recommend re-setting the default installation location when you are done moving apps. The reason for this is that apps will fail to be installed directly to the external location, at least this is what I experienced when trying to re-install the twitter app.

To reset the install location to automatic (let the system decide) use the following:

./adb shell pm setInstallLocation 0

Should you forget where it was left at you can always run:

./adb shell pm getInstallLocation

e.g:

$ ./adb shell pm getInstallLocation
0[auto]

Source : Muffinresearch