# IT:AD:MSDeploy:HowTo:Find the MSDeploy.exe location #
* [[../|(UP)]]
{{indexmenu>.#2|nsort tsort}}
You need to know where MSDeploy.exe was installed to before you can invoke it in a script.
The location it is at depends on what version we are talking about.
## Process ##
My current V3 location is:
C:\Program Files\IIS\Microsoft Web Deploy V3\
I got that by investigating the Registry, in the same way as it was done in the `*.cmd` file that [[IT/AD/Visual Studio/]] 2012 automatically creates:
@rem ---------------------------------------------------------------------------------
@rem Please Make sure you have Web Deploy install in your machine.
@rem Alternatively, you can explicit set the MsDeployPath to the location it is on your machine
@rem set MSDeployPath="C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\"
@rem ---------------------------------------------------------------------------------
@rem ---------------------------------------------------------------------------------
@rem if user does not set MsDeployPath environment variable, we will try to retrieve it from registry.
@rem ---------------------------------------------------------------------------------
if "%MSDeployPath%" == "" (
for /F "usebackq tokens=1,2,*" %%h in (`reg query "HKLM\SOFTWARE\Microsoft\IIS Extensions\MSDeploy" /s ^| findstr -i "InstallPath"`) do (
if /I "%%h" == "InstallPath" (
if /I "%%i" == "REG_SZ" (
if not "%%j" == "" (
if "%%~dpj" == "%%j" (
set MSDeployPath=%%j
))))))