Windows

Configure applications as “Run as an Administrator”

User Account Control kicks in when you try to run some applications (Administrative tools for example), you have to click UAC window. Or some times you simple want to run an application with high privileges and your lazy you don’t want to right click and select “Run as an Administrator” option. Here is the easy way.

1. On the Start menu, locate the program that you want to always run as an administrator.
2. Right-click the application’s shortcut, and then click Properties.
3. In the Properties dialog box, click the Compatibility tab.
4. Do one of the following:

  • To apply the setting to the currently logged-on user, select the Run This Program As An Administrator check box, and then click OK.
  • To apply the setting to all users on the computer and regardless of which shortcut is used to start the application, click Change Setting For All Users to display the Properties dialog box for the application’s .exe file, select the Run This Program As An Administrator check box, and then click OK twice.

Microsoft releases critical update for Remote Desktop

Microsoft has released a critical update that addresses a Remote Desktop flaw that affects all versions of Windows. On top of that, the company anticipates an exploit to be developed by hackers.

From Microsoft:  “We urge you to promptly apply this security update. We also encourage you to consider how you might harden your environment against unauthenticated, attacker-initiated RDP connections

Microsoft is strongly encouraging everyone to make “special priority of applying this particular update” due to its threat. Even though the remote desktop protocol is disabled by default, Microsoft expects hackers to create an exploit for code execution within the next month.
Remote Desktop Protocol is disabled by default, so a majority of workstations are unaffected by this issue. However, we highly encourage you to apply the update right away on any systems where you have enabled it.

 

Download Link:  Microsoft Security Bulletin MS12-020 – Critical

Disk usage in Windows

Windows does not have any in-built command(Like the Linux command du) which show the disk usage statistics for a directory. However, there’s a downloadable tools from SysInternals(now part of Microsoft) which can show us the disk usage numbers.

Du.exe version 1.4 can be downloaded from the below link.

http://technet.microsoft.com/en-us/sysinternals/bb896651

Find the disk usage of a directory

Command for finding the size of a directory is:

Example:

To find the size of the folder C:Windows, the command would be:

 Find the disk usage of a drive

Using du command we can find the current disk usage of a disk drive also.
Example:

Windows Sysinternals – Auto system reboot

The application is called PsShutdown, and is downloadable for free:

http://technet.microsoft.com/en-us/sysinternals/

PsShutdown is quite similar to “regular” shutdown – the former accepts the same parameters as the latter, but has various additional features, such as logging off users, locking the work station, and foremost: shutdown of the system when nobody’s logged in, or when the console is locked.

Usage sample

Suppose you need to reboot your system once a week. You would then create a Scheduled task (using the built-in Windows task scheduler), set to be executed once a week, using a privileged account (i.e. an account which is capable of doing the system reboot), and run this command:

psshutdown -f -r -m “automated planned reboot” -e p:0:0

Remove Windows Service

By executing the following command you can remove a windows service:

C:> sc delete [service name]

TIP:  If you don’t know the service name you’re trying to delete, you can find it by going to Start>Run>services.msc and locate the service name in the service’s property page.

 

Attn:  No screenshots were harmed in forming this post.

How to Setup a Windows 2008 R2 SNTP/NTP Server

 

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry entry:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig
  3. In the right pane, right-click AnnounceFlags, and then click Modify.
  4. In the Edit DWORD Value dialog box, under Value data, type 5, and then click OK.
  5. Enable NTPServer.
    1. Locate and then click the following registry subkey:

      HKEY_LOCAL_MACHINESYSTEMCurrentControlSet
      ServicesW32TimeTimeProvidersNtpServer

    2. In the right pane, right-click Enabled, and then click Modify.
    3. In the Edit DWORD Value dialog box, type 1 under Value data, and then click OK.
  6. Exit Registry Editor.
  7. At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:net stop w32time && net start w32time

This should get you setup with minimal registry hack impact.

Tips

  • Make sure W32Time is set to Automatic startup mode.
  • Make sure UDP 123 is allowed through your firewall.

How to Use the Traceroute Command (windows)

Traceroute is a command which can show you the path a packet of information takes from your computer to one you specify. It will list all the routers it passes through until it reaches its destination, or fails to and is discarded. In addition to this, it will tell you how long each ‘hop’ from router to router takes.

In Windows, select Start > Programs > Accessories > Command Prompt. This will give you a window like the one below.

Enter the word tracert, followed by a space, then the domain name.

As you can see I am tracing the route to goolge.com, it shows the IP Address of google.com

Next it gives info about each router it passes through on the way to the destination.

1 is the internet gateway on the network (yours)
2 is the ISP (my ISP)
3-10 are routers on the web
11 is the server (gateway) that the google.com is hosted from.

 

 

 

The Case of the Mysterious Reboots

Mark Russinovich over on technet.com posted a new article on killing malware using Sysinternal Suite Tools.

I felt it was necessary to share.
The Case of the Mysterious Reboots – Mark’s Blog – Site Home – TechNet Blogs

Disable Error Reporting in Server 2003

This is not something I recommend you do, as this limits the ability to properly obtain details about errors in applications which reside on your server.  However there are times where the application developers and support staff are reluctant to resolve the issue so you take steps to prevent these error log messages from running your system out of space.   – I choose to kill them all (not the dev’s just the messages)

Go to Control Panel.
Click System.
Go to the Advanced tab.
Click Error Reporting.
Click the “Disable Error Reporting” radio box, but select the “But notify me when Critical Errors Occur”.

VHD! Booting Windows 8

Why wipe your system clean to preview Windows 8 developer preview when you can simply use the good old VHD to boot it up on your system.

Here is the quickest method to do this.  <Warning — This is GEEK / not GREEK >

  • Boot from the Win8dev DVD or USB
  • When in setup the disk selection appears where to install to you press SHIFT-F10
  • A cmd window appears.
  • Now your drive letters may have shifted so do some DIR commands where you want the put the VHD file also choose a volume that has enough free space.
  • Then run diskpart:
    • create vdisk file=d:win8dev.vhd type=expandable maximum=50000 (for better performance do not use expandable, but creating the VHD may take some time.
      I choose about 50 GB in size
    • select vdisk file=d:win8dev.vhd
    • attach vdisk
  • Now alt-tab back to the disk selection window and click refresh, the VHD volume should appear, select it to install Windows in it.
  • Click next, Windows will install and reboot into next phase of Windows 8 setup
  • After another reboot the new Metro style boot menu appears where you can choose to boot from Windows 8 or Windows 7. Advanced options lets you set the default and change timeout. Also troubleshooting options are here.
  • The default is Windows 8 and it will run direct on your hardware