I want to give a message if the batch file is not present.

I left off the "t" in bat to point to a non-existant file.


      invoke GetStartupInfo, addr StartupInfo
invoke GetEnvironmentVariable, CTEXT('ComSpec'), addr szComspec, sizeof szComspec
invoke wsprintf, addr szAppname, CTEXT('"%s" /c "c:\Bat\J_Cruzer.ba"'), addr szComspec
invoke CreateProcess, 0, addr szAppname, 0, 0, FALSE, \
NORMAL_PRIORITY_CLASS, 0, 0, addr StartupInfo, addr ProcessInfo

.IF EAX == 0
  invoke MessageBox, 0, ADDR No_Batch_File, ADDR AppName,MB_ICONINFORMATION
  invoke  ExitProcess,NULL


invoke WaitForSingleObject, ProcessInfo.hProcess, INFINITE
Posted on 2011-01-18 15:20:02 by skywalker
Where finding is concerned, with GetCurrentDirectory you always have partial
success because you find parts of the file path and file name if your buffers
are big enough. But you don't get execution success unless you have the exact
file name and path.  See attached files.
Posted on 2011-03-19 08:49:05 by roaknog