Skip to main content

I have a confusion between the different operating systems 32 and 64 BIT.

We have a small local area network working under Windows XP with the

SMALL BUSINESS SERVER 2003, all terminals running with 32 BIT

 

The only exception is my computer with Windows 7 in 64 Bit version.

 I have the following BAT file in order to look for open files in the server

OPEN-FILES.BAT contains:

s:

openfiles /query /v /s servidor >archivo.txt

notepad archivo.txt

 

If I run this file from C:\\   or from s:\\ it works fine, because it changes to the server disk S:

 

I included this same BAT file in a NETEXPRESS program.

 

000001 ID DIVISION.

000002 PROGRAM-ID. TEST-BAT.

000005 ENVIRONMENT DIVISION.

000006 SPECIAL-NAMES.           call-convention 74 is winapi.

000006 DATA DIVISION.

000007 FILE SECTION.

000008

000009 WORKING-STORAGE SECTION.

000273 01 CmdLine                         pic x(256).

000274 01 CmdShow                         pic 9(04) comp-5.

000275 01 CmdStatus                       pic 9(04) comp-5.

000035

000036 PROCEDURE DIVISION.

           MOVE "open-files.BAT" & X"00"      TO CmdLine.

           display CmdLine AT 0101.

           MOVE 1 TO CmdShow,

           call winapi "WinExec"

                     using by reference CmdLine

                           by value     CmdShow

                           returning         CmdStatus.

 

             DISPLAY "CmdStatus " CmdStatus.

             STOP " END".

 

But it does not work. I receive a message that says the destination must work under 32 BIT.

 

If I include the following in the program

         call "PC_SET_DRIVE" using   "S"

                           returning CmdStatus.

 

The result is exactly the same

 

Is there any directive to indicate that the target disk works unter 32 BIT

 I tryed already putting the whole BAT file in the program, but the result is more or less the same.

It does not work.

Any idea what to do?

Thanks

Rolf

 

 

I have a confusion between the different operating systems 32 and 64 BIT.

We have a small local area network working under Windows XP with the

SMALL BUSINESS SERVER 2003, all terminals running with 32 BIT

 

The only exception is my computer with Windows 7 in 64 Bit version.

 I have the following BAT file in order to look for open files in the server

OPEN-FILES.BAT contains:

s:

openfiles /query /v /s servidor >archivo.txt

notepad archivo.txt

 

If I run this file from C:\\   or from s:\\ it works fine, because it changes to the server disk S:

 

I included this same BAT file in a NETEXPRESS program.

 

000001 ID DIVISION.

000002 PROGRAM-ID. TEST-BAT.

000005 ENVIRONMENT DIVISION.

000006 SPECIAL-NAMES.           call-convention 74 is winapi.

000006 DATA DIVISION.

000007 FILE SECTION.

000008

000009 WORKING-STORAGE SECTION.

000273 01 CmdLine                         pic x(256).

000274 01 CmdShow                         pic 9(04) comp-5.

000275 01 CmdStatus                       pic 9(04) comp-5.

000035

000036 PROCEDURE DIVISION.

           MOVE "open-files.BAT" & X"00"      TO CmdLine.

           display CmdLine AT 0101.

           MOVE 1 TO CmdShow,

           call winapi "WinExec"

                     using by reference CmdLine

                           by value     CmdShow

                           returning         CmdStatus.

 

             DISPLAY "CmdStatus " CmdStatus.

             STOP " END".

 

But it does not work. I receive a message that says the destination must work under 32 BIT.

 

If I include the following in the program

         call "PC_SET_DRIVE" using   "S"

                           returning CmdStatus.

 

The result is exactly the same

 

Is there any directive to indicate that the target disk works unter 32 BIT

 I tryed already putting the whole BAT file in the program, but the result is more or less the same.

It does not work.

Any idea what to do?

Thanks

Rolf

 

 

On a 64-bit OS there are two versions of this openfiles program, a 64-bit version in the C:\\windows\\system32 folder and a 32-bit version in the C:\\windows\\syswow64 folder.

If you start a 32-bit command prompt you will get the 32-bit version.
If you start a 64-bit command prompt you will get the 64-bit version.
On Windows 7 64-bit you must run the 64-bit version of this program.

If you are linking your Net Express program as 64-bit then your program would run as is.
If you are linking as 32-bit then it will find the 32-bit version of the program and report the error.

If you modify your .bat file to specify the following for the openfiles command it will run on a 64-bit system from a 32-bit application.

%systemroot%\\sysnative\\cmd.exe /c openfiles /query /v /s servidor >archivo.txt

I found a good article that explains this here: