I have this strange issue only seen on Windows 2008. On Windows 2003, I am running fine.
My C++ program will calls a bat file, using the system() command. Inside the batch file, it will call the wlbs command. However, when running the batch file from the program, I see the following error:
'wlbs' is not recognized as an internal or external command, operable program or batch file.
I echoed the %PATH% environment variable and see that C:\Windows\System32 is already there.
If I run the batch file from the same user account that I am starting the program from, on the command line, the batch file was able to invoke the command successfully. I already selected the program to be ran as Administrator, and my login session is also administrator.
I updated the batch file to output the dir listing, like "dir C:\Windows\System32\*.exe > list.txt" and surprisingly, in the list.txt, it was able to list out other exe except for the wlbs.exe (and I suspect a bunch of other exe were missing as well), when I run the batch file from my program.
However, when I run the batch file from the commandline, I was able to see the wlbs.exe from the list.txt generated from above. It seems that the issue only happens if the batch file was invoked from the program.
I also attempt to update the file permission for C:\Windows\System32\wlbs.exe but the update options are disabled by default, despite that I am logged in as Administrator already on the system.
Any help on the above issue would be appreciated.