Opening outlook in safe mode via powershell - email

How do you open Outlook in safe mode by default? Is there a powershell/cmd script I can use?
I'm assisting a user who's Outlook crashes after every 2nd email. The user doesn't experience these issues while opening Outlook in safe mode. User is currently able to access outlook in safe mode by holding down the ctrl key and double-clicking the Outlook icon. Looking for an easier solution for user such as a desktop icon.

Copy\Paste from here:
- If you are using Windows Vista or Windows 7, then there is a Search box in the Start Menu. Here type outlook.exe /safe
- In Windows 8, the search box will automatically show when you start typing. So simply open the Start Screen and type outlook.exe /safe
- In Windows 10, there is a search box on the Taskbar by default but if you have set to hide this, it will automatically show when you start typing after opening the Start Menu as well. Here type outlook.exe /safe
- You can also create a new shortcut to outlook.exe and add the /safe switch;
First, determine the location of outlook.exe on your system. In general you’ll find it under;
32-bit version of Windows
C:\Program Files\Microsoft Office\Office
64-bit version of Windows
C:\Program Files (x86)\Microsoft Office\Office
If you can’t find it, do a search for outlook.exe or use OutlookTools (free) instead.
Once you’ve found outlook.exe we create a shortcut to it with the /safe switch to prevent Outlook from opening an extra window each time you click the shortcut or use your keyboard shortcut.
Right click on an empty space on your Desktop and choose New-> Shortcut
Type the path to outlook.exe between quotes or browse to its location via the Browse… button
Type a space behind that and /safe
The entire line should now look like this (example is for a 32-bit version of Outlook 2010 on a 64-bit version of Windows);
"C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE" /safe
Click Next
Name your shortcut for instance: Outlook Safe Mode
Click Finish

Related

Outlook Reset Navigation Pane

I have been trying to Automate a PowerShell script for Outlook Navigation Pane Reset But I don't Know exactly what it changes.
I changed the Navigation Options, Views, Folder Pane, reading Pane Settings manually and then I tried OUTLOOK.EXE \resetnavepane from Run, "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /resetnavpane From Command Prompt and & "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /resetnavpane From Powershell but I see no change in Outlook it just restarts outlook in a new window with the same settings I changed manually.
Outlook keeps its settings in the windows registry keys. You must search for settings in the windows registry instead of relying on the command line arguments. For example, you may find the following thread helpful - navigation bar moved to left.

Powershell -command text not appearing

Windows 10, Powershell -v 5.1
I have tried to restore powershell to defaults, both normally and as admin. I have changed/turned off high contrast settings, deleted console files for powershell in Regedit, as well as tried to restore defaults from command line scripts.
Have tried restarting after applying all of this, but much of my output text is invisible, as well as commands with only one "-" dash, but commands with "--" appear.
See in pics below
no - identifiers
Invisible "-i"
Reappearing "--i"
Invisible Surge Data
It sounds like you've persistently modified the console-window colors in a manner that renders certain syntactic elements invisible.
You can either modify your console-window settings interactively - which may be nontrivial - or you can try to restore the original colors by recreating
the shortcut files that start your console windows:
Shortcut files (*.lnk files) contain their own console-window settings, which are independent of the defaults defined for console windows in the [HKEY_CURRENT_USER\Console] registry key and its subkeys named for specific executable names / window titles.
Therefore, even if you remove [HKEY_CURRENT_USER\Console] or specific subkeys, starting a program via a shortcut file will still apply the settings stored inside that shortcut file.
To bypass the shortcut-file settings ad hoc, you can start your program directly, using the Run dialog:
Press WinKey+R and enter powershell (for Windows PowerShell) or pwsh (for PowerShell Core), which applies only the registry defaults, if any.
However, to solve that problem persistently, you must modify or recreate the shortcut
file(s) you use to start your program:
To modify the shortcut:
Invoke your program via the shortcut,
then open the system menu (click on the icon in the top-left corner of the window),
select Properties
and modify the properties, notably the colors via the Colors tab.
To recreate the shortcut (instructions based on Windows 10):
In the Start Menu:
Right-click on the application of interest, then select More > Open file location.
In the taskbar:
Right-click on the application of interest, then right-click the application name and select Properties.
Activate the General tab
Copy the value of the Location: field - the folder in which the *.lnk file is located - to the clipboard.
Open File Explorer and paste the location into its address bar, which should open the folder in which the *.lnk file of interest is located.
Once you've located the *.lnk file of interest:
Make a note of:
its exact filename (typically: Windows PowerShell)
its target command line, by right-clicking the file, selecting Properties, selecting the Shortcut tab and copying the value of the Target: field.
its startup directory, as noted in the Start in: field.
Delete the *.lnk file.
Recreate it with the previously noted target command line:
Right-click in an empty part of the File Explorer window and select New > Shortcut
Paste the command line and click Next.
Specify the previous filename, and click on Finish.
Right-click on the new file, select Properties, and paste the startup directory into field Start in:, then click OK.
Drag the new *.lnk file into the Start Menu and/or taskbar, as needed.

Execute Powershell from File Explorer after installing VS Code

VS Code is trying to position itself as a new way to work with Powershell, and one of the changes it makes upon installation is to replace the File Explorer context menu option "Run with PowerShell" on .ps1 files with a new "Open with Code" option instead.
Is there a way to remove the "Open with Code" option and replace it with the old "Run with PowerShell" option? I assume this would involve the registry somehow but I don't know enough about the registry in general to do it safely.
Try this:
Save the following contents into a file "EnablePowerShellRightClickRun.reg", then right click - merge.
Then it doesn't matter which application you associate .ps1 files with - you still have "Run with Powershell" as a right click option.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\.ps1]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.ps1\shell]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.ps1\shell\RunPS]
#="Run with Powershell"
[HKEY_CLASSES_ROOT\SystemFileAssociations\.ps1\shell\RunPS\command]
#="\"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe\" -File \"%1\""
VS Code is not really positioning itself as the new way to work with PowerShell, it will be the only "built-in" way with Windows to work with it because the PowerShell ISE is being depreciated.
Either way, VS Code did not cause that option to disappear. I have VS Code and the PS extension on my machine and still have access to both options:
When you install VS Code you are prompted to add the right-click menu options, so if you opt'ed into those then it is not what removed your "Run with PowerShell" option.
If you want to remove those right-click options then you would have to uninstall VS Code and install it again, making sure those options are not checked.
To restore your menu option to Run with PowerShell verify you have not changed the default program for PowerShell files (e.g. ps1). If you set that to VS Code it will cause the option to be removed from your right-click menu. You can restore it by changing the default program in Windows back to Notepad.

Configure Autohotkey to edit scripts with Notepad++

I have my default editor for .ahk files set to Notepad++ Portable on my work laptop, but selecting Edit This Script opens files in the standard Windows Notepad.
A post on the AHK forums suggests editing the registry, but I don't see any entries under HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command.
How can I configure AutoHotkey to edit scripts with Notepad++?
For whatever reason, the Registry entry doesn't exist by default, but it is recognized by the application once created.
Navigate to HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell in RegEdit.
Right-click the Shell folder, select New > Key and name this Edit.
Right-click the Edit folder, select New > Key and name this Command.
Double click the (Default) string entry in Command.
Paste in "C:\Program Files\Notepad++\Notepad++.exe" "%1" to this window.
Reload AutoHotkey for the changes to take effect.
Note: I don't use Notepad++, but this works for VS Code on my system, and will for N++ as long as the directory information for the executable is correct.
The corresponding .reg file looks like this:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command]
#="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
The registry entry in item 5 of the previous answer did not work. I don't even know what the extra %* at the end means, so I simplified it to:
"C:\Program Files\Notepad++\Notepad++.exe" "%1"
For AHK version 2, changing the registry didn't work for me (I tried both Computer\HKEY_CLASSES_ROOT\AutoHotkeyScript\Shell\Edit\Command and Computer\HKEY_CLASSES_ROOT\.ahk\Shell\Edit\Command), but this did it for me. It adds two menu items to the AHK tray menu after a divider:
EditWithNotepadPlusPlus(*)
{
Run "C:\Program Files\Notepad++\notepad++.exe " A_ScriptFullPath
}
EditWithVsCode(*)
{
Run "C:\Program Files\Microsoft VS Code\Code.exe " A_ScriptFullPath
}
A_TrayMenu.Add()
A_TrayMenu.Add("Edit with VS Code", EditWithVsCode)
A_TrayMenu.Add("Edit with Notepad++", EditWithNotepadPlusPlus)
return
If you are like me and you are hesitant to modify the registry, there is a way to do this using AutoHotKey code.
This is a method I use to edit the script with a different editor. Although I am using Visual Studio Code, the method is the same no matter which editor you want to use. One caveat though: we can't change the existing "Edit This Script" menu item, since that is considered one of the standard menu items and can't be modified. Instead I am adding a new menu item at the top of the menu that says "Edit With Notepad++".
EditWithNotepadPlusPlus()
{
Run "C:\Program Files (x86)\Notepad++\notepad++.exe" "%A_ScriptFullPath%"
}
; Remove the standard menu items temporarily
Menu, Tray, NoStandard
; Add our custom menu item labeled "Edit With Notepad++"
; and calls the function above
Menu, Tray, Add, Edit With Notepad++, EditWithNotepadPlusPlus
; Add a separator
Menu, Tray, Add
; Put the standard menu items back, under our custom menu item
Menu, Tray, Standard
Note: If you're wondering, the lines Menu, Tray, NoStandard and Menu, Tray, Standard are not required. The reason I use those lines is because by default, Menu, MenuName, Add adds menu items to the bottom of the menu. For aesthetic and practical reasons, I prefer Exit to be the last menu item. So Menu, Tray, NoStandard and Menu, Tray, Standard will cause our menu item to appear at the top.
One added benefit of this method is that if you transfer your scripts to a new computer, it should still work (provided you have Notepad++ installed on the other computer). If you edit the registry, you have to remember to edit the registry again.
Using AHK v1.1.3.02 on Win10 with string
"C:\Program Files\TextPad 8\TextPad.exe" "%1"
worked well.
The registry change mentioned in other answers for me worked, but you may want to further add the following flags:
C:\Program Files (x86)\Notepad++\notepad++.exe %1 -multiInst -nosession
These flags will stop Notepad++ from recognizing this window as part of your overall session, so it won't overwrite your normal session history or anything. I don't remember where I first found these solutions but I'm switching computers atm and found them in my registry and noticed they weren't mentioned anywhere in this thread.
Was not working for me, i fixed it by first using the suggestion by R River
C:\Program Files (x86)\Notepad++\notepad++.exe %1 -multiInst -nosession
But this would create a new session each time, so i tried removing the end parameters and it now works.
C:\Program Files (x86)\Notepad++\notepad++.exe %1
Simplest way I've found is to:
Right click the .ahk file
Select "Open with" -> "Choose another app"
Check "Always use this app to open .ahk files"
Then select NotePad++ from the list
If it's not listed select "More Apps" and scroll down to NotePad++. (Mind you this example is Windows 10 specific, but previous versions are very similar.)
Editing the registry is great, don't get me wrong, but it takes longer. It's kinda like using a truck to swat a fly! Anyways, hope this works for you. I use it all the time to set the file associations I want.

"Open containing folder" hotkey in Visual Studio 2012

In versions of Visual Studio before 2012, I was able to create a hotkey to perform "Open Containing Folder" for the current active text file. I accomplished this by creating a macro that had a keystroke assigned to it.
Visual Studio 2012 does not have macros. How would I accomplish the above in this version?
Unfortunately you'll now need to download the VSSDK and create a VSPackage to do that, now that macros have been dropped from the IDE.
The closest thing to a macro now is a PowerShell script, which you could run from the console but I'm not aware of any way to assign a keyboard shortcut to it.
Running PS outside of the IDE is an option (via an External Tool command with a keyboard shortcut configured), but obtaining the EnvDTE outside of process could be complicated.
EDIT: There is a much simpler solution. I can't believe I didn't realise it to begin with!
Simply go into Tools... Options... Environment... Keyboard locate File.OpenContainingFolder and assign a shortcut. This command will open the active document's containing folder.
I found a keyboard shortcut for Open Containing Folder: Alt + - + O
When you press Alt + - it opens Tab Context Menu Then you see that the shortcut key for Open Containing Folder is O key, then you should press O.