Execute from Current Directory
How to execute below command in CMD, so that it get executed wherever that folder is copied & it’s not hardcoded to folder
Test.cmd content…
C:\WINDOWS\system32\MSIexec.exe /i "\\xyz\abc\sources\test.msi" TRANSFORMS="\\xyz\abc\sources\test.mst" /QR
1 Comment
[ + ] Show comment
Answers (3)
Answer Summary:
Please log in to answer
Posted by:
SMal.tmcc
11 years ago
if you are in the directory you can use .\ dos call to call the current directory
to call something from a subdir below your current location (look at the mst call part below)
msiexec /i .\test.msi transforms=.\desktop\test.mst
in the above dos window this command would look for the msi is c:\users\tmcadmn.homer\ and the transforms at c:\users\tmcadmn.homer\desktop\
to install from one directory above your current location would be ..\
msiexec /i ..\test.msi which would look for the msi in c:\users
xyz\abc\sources
Posted by:
skj
11 years ago
Posted by:
skj
11 years ago
Its working with following command line....
MSIexec.exe /I "%~dp0test.msi" TRANSFORMS="%~dp0test.mst" /QR
Comments:
-
Remember when deploying that the local System account has no access to network resources and so will not be able to use a UNC path: it simply can't "see" it. - anonymous_9363 11 years ago
2) Use "%~DP0" as a prefix and DOS will use substitute it with the current directory:
MSIEXEC /i "%~DP0WHATEVER.MSI" TRANSFORMS="%~DP0SOMETRANSFORM.MST" [other switches/arguments]
Note that there is no backslash between the file name and the "%~DP0". - anonymous_9363 11 years ago