Categories
Win 7 Windows 7

Windows Update error 80072efd on Windows 7

For a couple months now I haven’t been able to update my precious Windows 7.  I would get a message that the updates failed with, “Windows Update error 80072efd.”  I tried all the steps from the Windows Help and Support window (running the Windows Update troubleshooter and adding the Windows Update websites to the Windows firewall exception list) to no avail.  Out of desperation I found a reference to correct this problem on Vista by running netsh winhttp reset proxy.  It worked!

Open a command prompt as administrator (Start / All programs / Accessories, right-click “Command Prompt” and select “Run as administrator”).

At the command prompt run:

netsh winhttp reset proxy

Try Windows Update update again.

Categories
Command Prompt Linux Win 7 Win7 Windows Windows 7 Windows Vista Windows7

Getting the Most out of Windows Command Prompt

If you are like me you use the command prompt a lot.  It seems each time I logon to a new system I have to setup the command prompt just the way I want.  The first thing I do is create a shortcut in the Quick Launch toolbar.  Next I modify that shortcut so it will better suit my needs.

Right-click the shortcut and select Properties.  On the Shortcut tab add ” /f:on” (without the quotes) to the Target – make sure there is a space between cmd.exe and /f:on, and if cmd.exe ends with a quote place the /f:on outside the quotes. This will enable file and directory name completion characters – you can use Ctl + d for directories and Ctl + f for files.  I also like to set the Start In target to C:.

Click the Options tab.  I like to increase the command history buffer to at least 100, this is especially useful if you have a command prompt open for a long time and want to scroll back through your previous commands.  Check discard old duplicates to, well, do just that.  And check QuickEdit mode.  This is a great one as it enables selecting text directly and pasting directly (with right-click) without having to right-click and select copy and/or paste.

Personally I don’t change the fonts or colors, but you may prefer different settings.  Play around, have fun.

Now click the Layout tab.  I normally increase the height and width of the window size a bit, especially with today’s higher resolution monitors.  And I definitely increase the screen buffer size height, usually to a couple thousand or more.  Make sure to increase the screen buffer width to at least match that of your window size width.

I usually leave “Let System Position Window” checked so Windows will tile subsequent command prompt windows:

See also:

CMD.exe /? (help) in Windows 7
Starts a new instance of the Windows command interpreter

CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string]

/C      Carries out the command specified by string and then terminates
/K      Carries out the command specified by string but remains
/S      Modifies the treatment of string after /C or /K (see below)
/Q      Turns echo off
/D      Disable execution of AutoRun commands from registry (see below)
/A      Causes the output of internal commands to a pipe or file to be ANSI
/U      Causes the output of internal commands to a pipe or file to be Unicode
/T:fg   Sets the foreground/background colors (see COLOR /? for more info)
/E:ON   Enable command extensions (see below)
/E:OFF  Disable command extensions (see below)
/F:ON   Enable file and directory name completion characters (see below)
/F:OFF  Disable file and directory name completion characters (see below)
/V:ON   Enable delayed environment variable expansion using ! as the
        delimiter. For example, /V:ON would allow !var! to expand the
        variable var at execution time.  The var syntax expands variables
        at input time, which is quite a different thing when inside of a FOR
        loop.
/V:OFF  Disable delayed environment expansion.

Note that multiple commands separated by the command separator ‘&&’
are accepted for string if surrounded by quotes.  Also, for compatibility
reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the
same as /C.  Any other switches are ignored.

If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (“) characters:

    1.  If all of the following conditions are met, then quote characters
        on the command line are preserved:

        – no /S switch
        – exactly two quote characters
        – no special characters between the two quote characters,
          where special is one of: &<>()@^|
        – there are one or more whitespace characters between the
          two quote characters
        – the string between the two quote characters is the name
          of an executable file.

    2.  Otherwise, old behavior is to see if the first character is
        a quote character and if so, strip the leading character and
        remove the last quote character on the command line, preserving
        any text after the last quote character.

If /D was NOT specified on the command line, then when CMD.EXE starts, it
looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
either or both are present, they are executed first.

    HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutoRun

        and/or

    HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorAutoRun

Command Extensions are enabled by default.  You may also disable
extensions for a particular invocation by using the /E:OFF switch.  You
can enable or disable extensions for all invocations of CMD.EXE on a
machine and/or user logon session by setting either or both of the
following REG_DWORD values in the registry using REGEDIT.EXE:

    HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorEnableExtensions

        and/or

    HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorEnableExtensions

to either 0x1 or 0x0.  The user specific setting takes precedence over
the machine setting.  The command line switches take precedence over the
registry settings.

In a batch file, the SETLOCAL ENABLEEXTENSIONS or DISABLEEXTENSIONS arguments
takes precedence over the /E:ON or /E:OFF switch. See SETLOCAL /? for details.

The command extensions involve changes and/or additions to the following
commands:

    DEL or ERASE
    COLOR
    CD or CHDIR
    MD or MKDIR
    PROMPT
    PUSHD
    POPD
    SET
    SETLOCAL
    ENDLOCAL
    IF
    FOR
    CALL
    SHIFT
    GOTO
    START (also includes changes to external command invocation)
    ASSOC
    FTYPE

To get specific details, type commandname /? to view the specifics.

Delayed environment variable expansion is NOT enabled by default.  You
can enable or disable delayed environment variable expansion for a
particular invocation of CMD.EXE with the /V:ON or /V:OFF switch.  You
can enable or disable delayed expansion for all invocations of CMD.EXE on a
machine and/or user logon session by setting either or both of the
following REG_DWORD values in the registry using REGEDIT.EXE:

    HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorDelayedExpansion

        and/or

    HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorDelayedExpansion

to either 0x1 or 0x0.  The user specific setting takes precedence over
the machine setting.  The command line switches take precedence over the
registry settings.

In a batch file the SETLOCAL ENABLEDELAYEDEXPANSION or DISABLEDELAYEDEXPANSION
arguments takes precedence over the /V:ON or /V:OFF switch. See SETLOCAL /?
for details.

If delayed environment variable expansion is enabled, then the exclamation
character can be used to substitute the value of an environment variable
at execution time.

You can enable or disable file name completion for a particular
invocation of CMD.EXE with the /F:ON or /F:OFF switch.  You can enable
or disable completion for all invocations of CMD.EXE on a machine and/or
user logon session by setting either or both of the following REG_DWORD
values in the registry using REGEDIT.EXE:

    HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorCompletionChar
    HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorPathCompletionChar

        and/or

    HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorCompletionChar
    HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorPathCompletionChar

with the hex value of a control character to use for a particular
function (e.g.  0x4 is Ctrl-D and 0x6 is Ctrl-F).  The user specific
settings take precedence over the machine settings.  The command line
switches take precedence over the registry settings.

If completion is enabled with the /F:ON switch, the two control
characters used are Ctrl-D for directory name completion and Ctrl-F for
file name completion.  To disable a particular completion character in
the registry, use the value for space (0x20) as it is not a valid
control character.

Completion is invoked when you type either of the two control
characters.  The completion function takes the path string to the left
of the cursor appends a wild card character to it if none is already
present and builds up a list of paths that match.  It then displays the
first matching path.  If no paths match, it just beeps and leaves the
display alone.  Thereafter, repeated pressing of the same control
character will cycle through the list of matching paths.  Pressing the
Shift key with the control character will move through the list
backwards.  If you edit the line in any way and press the control
character again, the saved list of matching paths is discarded and a new
one generated.  The same occurs if you switch between file and directory
name completion.  The only difference between the two control characters
is the file completion character matches both file and directory names,
while the directory completion character only matches directory names.
If file completion is used on any of the built in directory commands
(CD, MD or RD) then directory completion is assumed.

The completion code deals correctly with file names that contain spaces
or other special characters by placing quotes around the matching path.
Also, if you back up, then invoke completion from within a line, the
text to the right of the cursor at the point completion was invoked is
discarded.

The special characters that require quotes are:
    
     &()[]{}^=;!’+,`~

Categories
cmd scripting shortcut Win 7 Win7 Windows Windows 7 Windows Vista Windows7 wscript

Create Windows Shortcuts With a Script at the Command Line

If you are like me you 1) access numerous Windows computers, in my case mainly servers through Remote Desktop; and 2) like to have your Windows desktop setup a certain way.  Here are some examples of a quick and easy way to create shortcuts with a script.  These examples are Visual Basic Scripts (.vbs) and use Windows Script Host to execute.  Create any or all of the examples and execute it from either the command prompt or Start / Run using:

wscript xyz.vbs

Note: These scripts were all tested on Windows 7, Windows 2008 and 2003.  They should run fine on earlier versions of Windows (XP, Vista, 2000, etc.) as well.

Although most of these examples will create shortcuts to Windows Explorer (the last one is a shortcut to the Command Prompt), they are being placed in different locations.  Of course you could modify the examples to launch any program of your choosing.  Additionally you could combine them into one script that could be launched the first time you logon.

For easy reference I highlighted the values you may want to change to tailor the script to your needs.

Windows 7, Vista and Windows 2008 Server note: You will probably have to execute these with administrative rights.  One way to do this is to launch a command prompt (the old fashioned way – Start [All] Programs / Accessories / Command Prompt) using right-click and selecting “Run As Administrator.”

Example 1 – Shortcut to Windows Explorer in the “All Users” Desktop folder.  I named the script Explorer_Shortcut_on_AU_Desktop.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strDesktop = WshShell.SpecialFolders("AllUsersDesktop" )
set oShellLink = WshShell.CreateShortcut(strDesktop & "Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 2 – Shortcut to Windows Explorer in the “All Users” Start Menu folder.  I named the script Explorer_Shortcut_in_AU_Startmenu.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartMenu = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartMenu & "Windows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 3 – Shortcut to Windows Explorer in the “All Users” Startup folder.  I named the script Explorer_Shortcut_in_AU_Startup.vbs.  This will cause one instance of Windows Explorer to launch during logon.  If you’re like me you will be using it anyway, so why not have it open automatically.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartup & "programsstartupWindows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 4 – Shortcut to Windows Explorer in the “Current User” Quick Launch toolbar.  I named the script Explorer_Shortcut_in_CU_QuickLaunch.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AppData" )
set oShellLink = WshShell.CreateShortcut(strStartup & "MicrosoftInternet ExplorerQuick LaunchWindows Explorer.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%explorer.exe"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "%SystemRoot%explorer.exe"
oShellLink.Description = "Windows Explorer"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

Example 5 – Shortcut to Command Prompt in the Quick Launch toolbar for you, the current user.  I named the script CMD_Shortcut_in_CU_QuickLaunch.vbs.

set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AppData" )
set oShellLink = WshShell.CreateShortcut(strStartup & "MicrosoftInternet ExplorerQuick LaunchCommand Prompt.lnk" )
oShellLink.TargetPath = "%SYSTEMROOT%system32cmd.exe"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "Ctrl+Alt+C"
oShellLink.IconLocation = "%SystemRoot%system32cmd.exe"
oShellLink.Description = "Windows Command Prompt"
oShellLink.WorkingDirectory = "%HOMEPATH%"
oShellLink.Save

See also:

Categories
HyperTerminal Linux PuTTY SSH Telnet TeraTerm Win 7 Win7 Windows Windows 7 Windows Vista Windows7

Alternatives to HyperTerminal in Windows 7 and Vista

Beginning with Windows Vista Microsoft removed HyperTerminal (aka HyperTerm & Hyper Terminal).  Of course, this means it isn’t in Windows 7 either. There are several options you can use to replace its functionality.

  • PuTTYMy Recommendation
    • PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator.
  • WinRS (Windows Remote Shell)
    • If you only need remote shell access, you can use WinRS which was introduced in Windows Vista. To get help and see execution options with WinRS, run winrs /? at a command prompt.
  • Telnet is a simple, text-based program that you can use to connect to other devices over your local network or over the Internet.  Telnet can be executed right from the command prompt, although you may have to enable it in Control Panel.
  • Phone and Modem Options can be used to troubleshoot modem problems
    • Open Phone and Modem Options by clicking the Start button, Control Panel, Hardware and Sound, finally Phone and Modem Options.
  • Realterm is a terminal program specially designed for capturing, controlling and debugging binary and other difficult data streams. It is far better for debugging comms than Hyperterminal. It has no support for dialing modems, etc – that is what hyperterminal does.
  • TeraTerm is another alternative to HyperTerminal.  Tera Term is a free software terminal emulator (communication program) which supports:
    • Serial port connections.
    • TCP/IP (telnet, SSH1, SSH2) connections.
    • IPv6 communication.
    • VT100 emulation and selected VT200/300 emulation.
    • TEK4010 emulation.
    • File transfer protocols (Kermit, XMODEM, ZMODEM, B-PLUS and Quick-VAN).
    • Scripts using the “Tera Term Language”.
    • Japanese, English, Russian and Korean character sets.
    • UTF-8 character encoding.

  • AbsoluteTelnet Telnet, SSH, and SFTP Client.  AbsoluteTelnet / SSH is a secure flexible terminal client that is suitable for developers, administrators, or deployment across the enterprise. It includes the industry standard SSH protocols to secure terminal session data across insecure environments such as the internet. Its new tabbed interface is a favorite among AbsoluteTelnet users.
  • XP’s Hyper Terminal
    • If you really want (or just can’t be without it) you can still use XP’s Hyper Terminal. Just copy the following two files from an existing XP, Windows 2000 or 2003 box or extract them from the installation CD’s of the previous OS’s: hypertrm.dll and hypertrm.exe. Although you could put them anywhere on the disk as installation is not required, you may want to place them in %SYSTEMROOT% (normally C:WindowsSystem32).
Categories
Linux RichCopy Robocopy Win 7 Win7 Windows Windows 7 Windows Vista Windows7

RichCopy – RoboCopy GUI (sort of) by Microsoft

RichCopy is a free utility from Ken Tamaru of Microsoft. The tool was first developed in 2001 and has been updated regularly to keep pace with evolving needs.  Worthy of note is that RichCopy is a multithreaded copying tool. That means that rather than copying one file at a time in serial order, RichCopy can open multiple threads simultaneously, allowing many files to be copied in parallel and cutting the total time required to complete the operation several times over. You can also pause and resume file copy operations, so if you lose network connectivity at any point, you can just pick up where you left off.

Of course, these are really just the simplest features of RichCopy. As the figure below shows, you also get a vast array of granular controls that allow you to customize all of those fancy aspects of your file copying —filtering files, saving attributes, adjusting cache size, and so on. If you regularly copy lots of files over the network or between various storage devices, these features will significantly ease your daily life.

Download RichCopy.

For those of you like me who prefer the command line see the following about RoboCopy:

Categories
Linux Win 7 Win7 Windows 7 Windows Vista Windows7

Ultimate Windows Tweaker v 2.0 for Windows 7 and Vista

Ultimate Windows Tweaker v 2.0 is a freeware Tweak UI Utility for tweaking and optimizing Windows 7 & Windows Vista, 32-bit & 64-bit. It can simply be downloaded and used as a portable application to customize your Windows to meet your requirements. With judicious tweaking, it can make your system faster, more stable, and more secure with just a few mouse clicks. The tweaker detects whether you have Windows 7 or Windows Vista installed and accordingly offers you only the relevant tweaks.

The tweaker is a 345KB .exe file which does not require an install, yet packs over 150 tweaks & settings. Simply download the zip file, extract its contents and run Ultimate Windows Tweaker. Please don’t detach Empty Icon from executable’s root, the Empty Icon is copied to system directory and referred in runtime. The tweaker has been designed by Ramesh Kumar for The Windows Club.

Download Ultimate Windows Tweaker.  More information.


Categories
Command Line Linux UAC Win 7 Win7 Windows Windows 7 Windows Vista Windows7

Disable/Enable User Access Control (UAC) on Windows 7 or Vista from the Command Line

Microsoft introduced User Account Control (UAC) in Windows Vista. UAC enables users to perform common tasks as non-administrators, called standard users in Windows (Vista and Windows 7), and as administrators without having to switch users, log off, or use Run As. A standard user account is synonymous with a user account in Windows XP. User accounts that are members of the local Administrators group will run most applications as a standard user. By separating user and administrator functions while enabling productivity, UAC is an important enhancement for Windows.

Disable UAC from the command line

%systemroot%System32cmd.exe /k %windir%System32reg.exe ADD HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem /v EnableLUA /t REG_DWORD /d 0 /f

Enable UAC from the command line

%systemroot%System32cmd.exe /k %windir%System32reg.exe ADD HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesSystem /v EnableLUA /t REG_DWORD /d 1 /f

A couple caveats

  1. Must be run with administrative rights.  You could right-click on Command Prompt shortcut and select Run as Administrator.
  2. You may have to reboot for changes to take affect.

You can also enable or disable UAC from the Control Panel.

Categories
IIS 6 IIS 7 Win 7 Win7 Windows Windows 2008 Windows 7 Windows Vista Windows7

IIS 7 Log Files Default Location

In Internet Information Services 7 Microsoft changed the default log files location.

IIS 7 Log files location

%SystemDrive%inetpublogsLogFiles

IIS 6 Log files location

%windir%System32LogFiles

Categories
Linux Quick Launch TaskBar Win 7 Win7 Windows Windows 7 Windows7

How to Add Quick Launch to Windows 7 Task Bar

By default Windows 7 does not display quick launch on the taskbar like Windows XP and Vista.

How to Enable Quick Launch in Windows 7

  1. Right-click on taskbar.
  2. From Toolbars Menu select New Toolbar.
  3. Under Folder add: %appdata%MicrosoftInternet ExplorerQuick Launch then press Select Folder.
How to Unlock the Taskbar
  1. Unlock the taskbar by right-clicking on taskbar and select unlock the taskbar.
  2. To lock, do the same but select lock the taskbar.
Taskbar options
In Windows 7 quick launch you can choose whether to display the title and to show text or not.  To change these settings unlock the taskbar, right-click in the quick launch area of the taskbar and toggle Show Text and Show Title as desired.
Categories
FTP IIS 7 Linux SSL Win 7 Win7 Windows Windows 2008 Windows 7 Windows7

How to Install and Configure IIS 7 FTP Publishing Service

The new FTP Publishing Service 7.5 has been rewritten for Windows Server 2008 and lot of new futures and additions included. (Integration with IIS 7, FTP over SSL (from v7.0), Improved Logging, etc..)

Prerequisites
1. Internet Information Services 7.0 installed.
2. Windows Server 2008 or Vista.
3. Download FTP Publishing Service 7.5

4. Create a folder for FTP Publishing Service and allow Full access for Administrators

  • mkdir “c:inetpubftprootftp.mydomain.com”
  • cacls “c:inetpubftprootftp.mydomain.com” /G administrators:F /T /E

In case we want to add access to specific backup user we can use the following command”

  • cacls “c:inetpubftprootftp.mydomain.com” /G username:F /T /E

Permissions:

R  Read
W  Write
C  Change (write)
F  Full control

Installation
Before installing FTP Publishing Service 7.5 over IIS 7.0 be sure that you uninstall any previous versions of FTP Publishing Service.

  1. When the installation program of Microsoft FTP Service for IIS 7.0 begins, click Next.
  2. Accept the End-User License Agreement and click Next.
  3. Select the features you want to be installed and click Next.
  4. Click Install to begin the installation.
  5. At the end click Finish.

Creating the Certificate
After the installation finishes we open Internet Information Services 7.0  Manager and we select Server Certificates to create a self-signed SSL certificate. Another option is to create a certificate request to process with a 3rd party SSL provider which is recommended for production systems as they are from a trusted root.

Server Certificates

Click on Create Self-Signed Certificate…

Create a self-signed certificate

Specify a certificate name and click OK:

Specify certificate name


Creating the FTP Site
Right click the Sites node in the tree and click Add FTP Site…

Add FTP Site...

On the Add FTP Site wizard add the FTP site name and select the path we created in the prerequisites and click Next.

Add FTP Site Wizard

On the next page of the wizard we click the Require SSL option and we choose our SSL Certificate then we click Next.

Binding and SSL Settings

On the next page of the wizard we select Basic for Authentication and on Allow access to we select specified users and we define our backup ftp account with read and write permissions then we click on Finish. In case we want to allow anonymous ftp connections select Anonymous authentication and on Permissions we select the Read.

Authentication and Authorization Information


Configure the Firewall
If we are behind a firewall we should configure the FTP Firewall Support under Internet Information Services Manager and configure our firewall ports to accept passive connections on the ports we specify. In case we want to use dynamic port range under Data Channel Port Range we enter port range “0-0?.

FTP Firewall Support


Configure the FTP Client (FileZilla for example)
Configure FTP Client to connect to our FTP Site using FTP over explicit TLS/SSL.

FTP Client Settings


Troubleshooting
In case you get “534 Local policy on server does not allow TLS secure connections.” error this is because we need to select an SSL certificate at the Server Level.

FTP SSL Settings Server Level
FTP SSL Settings Certificate Selection