PDA

View Full Version : Execute from Current Directory



skjskj
11-20-2013, 10:29 AM
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

Mistral
11-20-2013, 10:34 AM
MSIexec.exe /i test.msi TRANSFORMS=test.mst /QR

skjskj
11-20-2013, 10:58 AM
MSIexec.exe /i test.msi TRANSFORMS=test.mst /QR

i get the following message...
This installation packages could not be opened. verify that the package exists

Mistral
11-20-2013, 02:26 PM
Just put TEST.CMD into the same directory where the MSI and the MST is.

skjskj
11-20-2013, 10:54 PM
Just put TEST.CMD into the same directory where the MSI and the MST is.

it works if i double click, but if i run as admin it doesnt work & says....
This installation packages could not be opened. verify that the package exists.

If we run as admin, by default it goes to c:\windows\system32 folder for executing.

Mistral
11-21-2013, 12:47 AM
Finally i understand why you try to accomplish.

MSIexec.exe /i "%~dp0\test.msi" TRANSFORMS="%~dp0\test.mst" /QR

skjskj
11-21-2013, 02:13 AM
Finally i understand why you try to accomplish.

MSIexec.exe /i "%~dp0\test.msi" TRANSFORMS="%~dp0\test.mst" /QR

Its working with above command line....even i got this command from one of the fren.

Thanks a lot for all your help :)