Wybuild running .exe within a .bat

Hi,

I currently have a .bat script that runs fine after an update except for calling a .exe program I wrote. It appears that either the program is failing or that it is just not being called from inside the .bat file.

This program does require elevation, but so do some other operations in the batch script and they appear to run fine. When I run the script outside of an update inside an elevated command prompt, it runs fine and is able to call into the .exe.

Any ideas on why this might be the case?

No, I need more information. Try adding logging to your bat file to see what's going on. Record the error code of the failure of the exe to see what the problem is.

I see. The error code is 9009. I believe this means that it could not find the .exe (the .bat file is looking for the .exe in the same directory).

This odd because in the temp directory, I created a new folder and placed both the .exe and the .bat file in it.

Show me the bat file code you're using to execute the exe.

Here is the .bat file I was using. I have since removed the call to ShortcutMaker.exe. Instead, I just run them both separately.--------------------@echo offsetlocal enableextensions enabledelayedexpansionecho Getting directoryset _key=HKLM\SOFTWARE\[Company]\[Product]set _uninstKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[Product]set _var=InstallDir

for /f "tokens=2,*" %%a in ('reg query %_key% /v Version ^| findstr Version') do ( set _version=%%b)

REM http://stackoverflow.com/questions/3213574/get-value-of-registry-keyREM query the value. pipe it through findstr in order to find the matching line that has the value. only grab token 3 and the remainder of the line. %%b is what we are interested in here.echo reg query %_key% /v %_var%for /f "tokens=2,*" %%a in ('reg query %_key% /v %_var% ^| findstr %_var%') do ( set productDir=%%b)

if "%productDir%"=="" ( echo Changing _key value set _key=HKLM\SOFTWARE\Wow6432Node\[Company]\[Product] set _uninstKey=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\[Product] for /f "tokens=2,*" %%a in ('reg query !_key! /v %_var% ^| findstr %_var%') do ( set productDir=%%b ) echo reg query !_key! /v Version ^| findstr %_var% for /f "tokens=2,*" %%a in ('reg query !_key! /v Version ^| findstr Version') do ( set _version=%%b ))

echo Product dir: "%productDir%"echo Version: "%_version%"echo Uninstall Key: "!_uninstKey!"reg add "!_uninstKey!" /f /v UninstallString /t REG_SZ /d "%productDir%\bin\Uninstall !_version!.exe"REM This is .exe that appears to not be executing from wyupdateShortcutMaker.exe %productDir%cd %productDir%del "Uninstall*"endlocal

And the problem is on what line?

The problem was on this line (fourth from the bottom):ShortcutMaker.exe %productDir%

But as I mentioned, I have since removed that line and am now executing the .exe on its own after the update is finished (as per the WyBuild option) along with the .bat file.