none
MDT Application - Running a batch file and copy file locally without absolute path??

    Question

  • I have an application defined in MDT along with its respective files. One of these files is an install and needs to be run locally. How do I copy this file locally then have it run? I've used a fair amount of batch scripts so I opted for that, but every batch script I get (even empty ones or one with just an exit) returns code 1. If I enter in cmd /c directly in the command line with the commands separated by && it would not work either.

    I DO not want to hardcode any IP into this which is why this is so hard. Is there no way to do this easily without a full \\IPADDY\Share?

    Wednesday, September 15, 2010 7:33 PM

Answers

  • You could make a self extracting EXE with WinZip, and then do something like..  (You would create an application with source files to do this, with the below code being your 'install.bat')

    @echo off

    xcopy "AppFiles.exe" %WINDIR%\Temp

    %WINDIR%\Temp\AppFiles.exe

    %WINDIR%\Temp\AppFiles\Install.exe

    RMDIR /S /Q %WINDIR%\Temp\AppFiles

     

    If you monitor the install and your satisfied its working correctly, you can modify the success return codes under the 'Option' tab, or just check the box 'Continue on Error' to keep the build rolling after this install is complete.  Additionally, you may find this works better as VBS script.

    • Marked as answer by MikeMorawski Thursday, September 16, 2010 2:52 AM
    • Edited by XxX sdk XxX Friday, September 17, 2010 5:36 PM
    Wednesday, September 15, 2010 7:46 PM

All replies

  • You could make a self extracting EXE with WinZip, and then do something like..  (You would create an application with source files to do this, with the below code being your 'install.bat')

    @echo off

    xcopy "AppFiles.exe" %WINDIR%\Temp

    %WINDIR%\Temp\AppFiles.exe

    %WINDIR%\Temp\AppFiles\Install.exe

    RMDIR /S /Q %WINDIR%\Temp\AppFiles

     

    If you monitor the install and your satisfied its working correctly, you can modify the success return codes under the 'Option' tab, or just check the box 'Continue on Error' to keep the build rolling after this install is complete.  Additionally, you may find this works better as VBS script.

    • Marked as answer by MikeMorawski Thursday, September 16, 2010 2:52 AM
    • Edited by XxX sdk XxX Friday, September 17, 2010 5:36 PM
    Wednesday, September 15, 2010 7:46 PM
  • I stumbled upon that idea taking a random walk in the day, not as elegant as I was hoping for but something that is easy to do! Thanks for the info it will speed up the work next time I come back to it. I feel like MDT could have done MUCH better in this area, considering how much complexity other areas are given.

    Thanks again

    Thursday, September 16, 2010 2:52 AM
  • Just an addition:

    No need for winzip or anything third party. Windows has a built in tool that I never heard of before (learn something everyday):

    run iexpress from start->run.

    Thursday, September 16, 2010 1:30 PM
  • Just want to give additional support for anyone in my previous set of shoes.

    Autoit seems to work well as it can trigger anything to start running that needs to be called from a program in the same directory as it is not bound by UNC paths.

    Also, winrar is great for setting up self extracting packages, MUCH better than iexpress. These can run scripts afterwards for anything that *needs* to be installed locally.

    Cheers!

    Wednesday, September 29, 2010 3:31 PM
  • Can you provide the steps you took to copy a file to a windows 7 local machine before installing it with mdt 2012, autoit, and winrar.  Or any other method that might work.  Im having issues getting Cisco VPN 5.0.07 installed via MDT, I keep getting "error-28006-vpn-client-failed-to-install".  I tried numerous ways to install using iexpress, batch files, vb scripts and cant seem to get any of them to work.
    • Edited by sjackson4430 Thursday, February 27, 2014 12:31 AM
    Thursday, February 27, 2014 12:30 AM