Use Command Line Switches in Outlook 2010

By default, running Outlook.exe will launch the program and start it normally in Windows. This is what occurs when you click on the Outlook desktop icon. However, there are many times where it would be useful to alter the startup of Outlook 2010 by adding a command line switch.

Instead of running outlook.exe, you can add a switch such as shown below:

outlook.exe /safe

This will launch Outlook without the Reading Pane or any toolbar customizations and will turn off any COM add-ins. A helpful command if Outlook is crashing because of a recently installed add-in.

You can run Outlook 2010 with a command line switch in one of two ways: using the Run command and creating a shortcut.

Run Command

In Windows Vista and Windows 7, click on Start, and then type Run into the Search box. Press Enter and the Run dialog box will appear.

Enter the full path to the Outlook.exe file and include the path in quotes. After the quotes, you can type in the command line switch as shown below:

“c:\program files\microsoft office\office14\outlook.exe” /safe

outlook 2010 command line switch

Windows Shortcut

If you want a more permanent solution, you could create a shortcut to the modified Outlook startup. Simply follow the first few steps of this previous article and type in the above mentioned path (including the quotes)where it says “Type the location of the item”.

Basically, you right-click on the Desktop and choose Create Shortcut Wizard. After that, you just give it a path and a name and you’re done.

Outlook 2010 Command Line Switches

Below are some of my favorite command line switches that I have used in an IT environment.

/a – Create a message with a specified file as an attachment, i.e. “c:\program files\microsoft office\office14\outlook.exe” /a “c:\my documents\test.doc”

/c messageclass – Creates a new item with a specific type of message class. Examples include:

  • /c ipm.appointment creates an appointment
  • /c creates a contact
  • /c ipm.note creates an e-mail message
  • /c ipm.task creates a task

/cleanautocompletecache – Removes everything, including names and email addresses, from the auto-complete list.

/cleanrules – Deletes all client and server based rules on Outlook startup.

/cleansharing– Useful if you cannot delete a RSS subscription from Outlook 2010. This will remove all RSS, Sharepoint, and Internet Calendar subscriptions from your account settings.

/nopreview – Starts Outlook 2010 with the Reading Pane turned off.

/safe – Starts Outlook without Reading Pane, Toolbar Customizations, and COM add-ins.

There are many more command line switches and you can read about the rest on the Office website:

If you need some help in using one of the switches, post a comment here and I will try to help! Enjoy!

Counting the number of files in a directory, command line style

I needed to count the number of files in a directory on a Windows 2003 server.  Here’s the command that can easily be scripted:

dir/b/a-d c:\directory | find /v /c “::”

You can also specify a file share instead of a directory name:

dir/b/a-d \\server\share | find /v /c “::”

If you want to count the number of files in a directory and all subdirectories, the command is:

dir/s/b/a-d \c:\directory | find /v /c “::”

Assigning Netware rights via the command line

Here at the office we have a group in charge of assigning and maintain user and group rights and permissions to our various systems.  It’s nice not having to worry about that aspect of server administration. 

But I have an urgent need to have some eDirectoy group rights assigned to a specific directory on every Netware server in our Enterprise.  The group that controls user access is saying that they can’t meet my timeframe for getting these rights assigned, so I had to come up with my own solution.

My solution was to use Wolfgang Schreiber’s  lrights.exe utility to script assigning the rights command line style.  The syntax is:

LRights <path> <rights> /name=<trustee>

For example, to assign read and file scan rights to the .mygroup.OU.O user:

lrights \\server\volume\directory R F /Name=.mygroup.OU.O

This utility was written to support long path/file names, unlike Novell’s rights.exe utility.

Howto: Authenticate to eDirectory via the Novell Client, command line style

I have a backup script that runs on a Windows 2003 server that requires Novell client authentication.  Here’s how to authenticate to eDirectory via the command line, which means it’s scriptable!  The syntax is:

c:\windows\system32\LOGINW32.EXE  .user.ou.o /PWD password /CONT

Alternatively, you could map a drive to an eDirectory server (Netware, SLES Linux or Windows), which would force background authentication.  Here’s that syntax:

net use x: \\server\vol /user:.user.ou.o password

Mark’s Windows 2008 DNS Server Command Line Cheat Sheet

If you’re a command line type administrator like myself you’ll want to check out Mark’s Mark’s DNS Server command line cheat sheet. He’s summarized the Windows Server 2008 CLI commands relating to DNS administration.


DNSCMD option



Do any dnscmd command on a remote system

dnscmd servername command

dnscmd /zoneprint


Create a primary zone

dnscmd /zoneadd zonename /primary

dnscmd /zoneadd /primary


Create a secondary zone

dnscmd /zoneadd zonename /secondary master IP address

dnscmd /zoneadd /secondary


Host a zone on a server based on an existing (perhaps restored) zone file

dnscmd /zoneadd zonename /primary /file filename /load

dnscmd /zoneadd /primary /file /load


Delete a zone from a server

dnscmd /zonedelete zonename [/f]

dnscmd /zonedelete /f

(without the /f, dnscmd asks you if you really want to delete the zone)

Show all of the zones on a DNS server

dnscmd /enumzones

dnscmd /enumzones


Dump (almost) all of the records in a zone

dnscmd /zoneprint zonename

dnscmd /zoneprint

Doesn’t show glue records.

Add an A record to a zone

dnscmd /recordadd zonename hostname A ipaddress

dnscmd /recordadd mypc A


Add an NS record to a zone

dnscmd /recordadd zonename @ NS servername

dnscmd /recordadd @ A


Delegate a new child domain, naming its first DNS server

dnscmd /recordadd zonename childname NS dnsservername

dnscmd /recordadd test NS

This would create the “” DNS child domain unter the DNS domain

Add an MX record to a zone

dnscmd /recordadd zonename @ MX priority servername

dnscmd /recordadd @ MX 10


Add a PTR record to a reverse lookup zone

dnscmd /recordadd zonename lowIP PTR FQDN

dnscmd /recordadd 3 A

This is the PTR record for a system with IP address

Modify a zone’s SOA record

dnscmd /recordadd zonename @ SOA primaryDNSservername responsibleemailipaddress serialnumber refreshinterval retryinterval expireinterval defaultTTL

dnscmd /recordadd @ SOA 41 1800 60 2592000 7200

Ignores the serial number if it’s not greater than the current serial number

Delete a resource record

dnscmd /recorddelete zonename recordinfo [/f]

dnscmd /recorddelete @ NS /f

Again, “/f” means “don’t annoy me with a confirmation request, just do it.”

Create a resource record and incorporate a nonstandard TTL

dnscmd /recordadd zonename leftmostpartofrecord TTL restofrecord

dnscmd /recordadd pc34 3200 A


Reload a zone from its zone file in \windows\system32\dns

dnscmd /zonereload zonename

dnscmd /zonereload

Really only useful on primary DNS servers

Force DNS server to flush DNS data to zone file

dnscmd /zonewriteback zonename

dnscmd /zonewriteback


Tell a primary whom to allow zone transfers to

dnscmd /zoneresetsecondaries zonename /nonsecure|securens

dnscmd /zoneresetsecondaries /nonsecure

That example says to allow anyone who asks to get a zone transfer

Enable/disable DNS NOTIFY

dnscmd /zoneresetsecondaries zonename /notify|/nonotify

dnscmd /zoneresetsecondaries /nonotify

Example disables DNS notification, which is contrary to the default settings.

Tell a secondary DNS server to request any updates from the primary

dnscmd /zonerefresh zonename

dnscmd /zonerefresh


Enable or disable dynamic DNS on a zone

dnscmd /config zonename /allowupdate 1|0

1 enables, 0 disables, 0 is default


Stop the DNS service

Either net stop dns or sc stop dns


(No dnscmd command for this)

Start the DNS service

Either net start dns or sc start dns


(No dnscmd command for this)

Install the DNS service on a 2008 full install system

servermanagercmd -install dns



Install the DNS service on a 2008 Server Core system

ocsetup DNS-Server-Core-Role


Case matters — ocsetup dns-server-core-role would fail

Uninstall the DNS service on a 2008 Server full install system

servermanagercmd -remove dns



Uninstall the DNS service on a 2008 Server Core system

ocsetup /uninstall DNS-Server-Core-Role



You’ll need to become intimately familiar with administering DNS via the command line if you’re running the Server Core version of Windows 2008.