Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Empty "NoWorkingDirectory" string value is often used in Windows Registry when user-defined Right-Click menu items are created. For example to be able to open PowerShell when right-clicking on folder backround in Windows Explorer (as opposed to right-clicking on folder itself, in that case "NoWorkingDirectory" is not used):

[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell]
@="Open PowerShell Here"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell\command]
@="C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%V'"

However, I am not clear on actual purpose of this value. It is always used empty in all samples I found. What exactly does it signify?

share|improve this question
    
I would imagine if there was a directory value it would only work in that directory. Do you have other examples? –  Ramhound Jan 17 at 20:48
    
    
windows7home.net/… –  Joe Schmoe Jan 17 at 20:53
    
My guess is that it's the folder used to execute from if there's no Working Folder provided when the shell command is called (similar to the "Start In:" option in a Shortcut's properties). When empty it probably assumes the current folder. But again, this is just guessing. ;) –  Ƭᴇcʜιᴇ007 Jan 17 at 21:47

1 Answer 1

WorkingDirectory is a property of the System.Diagnostics.ProcessStartInfo, when you Right Click, you are starting a new process and this setting allows you to start a process without the current directory becoming the "Working Directory". It then defaults to the System32 for the command being run.

So you would use "NoWorkingDirectory" when you are not wanting the location right clicked to become part of the environmental path for the duration of the script. Useless setting in 90% of cases, unless you have similar named files in multiple path locations which could get sticky unless "NoWorkingDirectory" is specified.

See more details here.

http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.workingdirectory%28v=vs.110%29.aspx

share|improve this answer
    
For instance, if I have a copy of DISM in a folder and right click on it, "NoWorkingDirectory" would allow me to access the copy in System32 over the one in the directory I right clicked on. See, it's kinda useless because more often than not I want the copy in the folder I clicked on. –  Knuckle-Dragger Jan 21 at 13:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.