64 Bit Winbatch EXE on 32bit OS

Started by Trippinout, March 09, 2016, 10:49:48 AM

Previous topic - Next topic

Trippinout

I have a pretty simple script that is calling several extensive VBS files.
If these VBS's are called via a 32bit process on a 64 bit OS, they will fail. I've compiled my Winbatch as a 64bit EXE and everything runs smoothly on 64 bit OS's, but obviously it won't run on a 32 bit OS.
I've tried several ways of calling the VBS files with CScript from a 32 bit compiled EXE and they will launch but with fail at certain points.

Does anyone have any ideas to create one EXE that will work on 32 and 64 bit OS's?

Thanks

td

Assuming you mean your 32-bit compiled script fails on 64-bit Windows, you could try IntControl 92 to temporarily disable file redirection in your 32-bit compiled script.  Make sure that you only turn it off to start each VB script and turn it back on immediately after.   Or you could simply get rid of the VBS script altogether.  Almost all VBS scripts can be converted to straight WIL COM.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Trippinout

32 bit compiled script causes these VBS files to fail.
64 bit compiled script works fine.

I have tried turning off redirection with IntControl 92 to no avail.
Also, I cannot convert the VBS scripts for supportability reasons.


td

Quote from: Trippinout on March 09, 2016, 11:26:46 AM
32 bit compiled script causes these VBS files to fail.
64 bit compiled script works fine.

Yes, got that but you did not nor have not explicitly said that the 32-bit compiled script failed on 64-bit systems. You stated that the VBS scripts failed when called from a 32-bit process.  The process could be the VBS process or the WinBatch process.   Hence the assumption...

Quote
I have tried turning off redirection with IntControl 92 to no avail.

The only purpose of using IntControl 92 is to get 32-bit WinBatch to start the 64-bit version of VBS interpreter.  The alternative is to use 'sysnative32' in the path to cscript instead of 'system32'. Once the 64-bit version is running it shouldn't make a lot of difference that it was started by a 32-bit process or not.

Quote
Also, I cannot convert the VBS scripts for supportability reasons.

I guess your out of luck then.  Although the nature of the failure should give you some clue to the specific nature of the cause.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

I incorrectly indicated 'sysnative32'.  It should be sysnative.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade