Skip to main content

Calling CMD/copy from DOS

  • December 18, 2019
  • 3 replies
  • 0 views

I have a program that copies a file from HP UX server to local Windows PC using C$COPY.

This works in thin client GUI, but how do I copy a file from the server in DOS mode (see picture)?

C$COPY does not work, so I tried calling a batch script with cmd.exe using C$SYSTEM with and without @[DISPLAY] but nothing is working. The compiler could not even find cmd.exe.

 

3 replies

Stephen Hjerpe
  • Participating Frequently
  • December 19, 2019

I have a program that copies a file from HP UX server to local Windows PC using C$COPY.

This works in thin client GUI, but how do I copy a file from the server in DOS mode (see picture)?

C$COPY does not work, so I tried calling a batch script with cmd.exe using C$SYSTEM with and without @[DISPLAY] but nothing is working. The compiler could not even find cmd.exe.

 

without your code it's difficult to tell. Does this help: https://community.microfocus.com/t5/Extend-and-AcuCOBOL-Forum/C-SYSTEM/m-p/1724121#M10375

 


without your code it's difficult to tell. Does this help: https://community.microfocus.com/t5/Extend-and-AcuCOBOL-Forum/C-SYSTEM/m-p/1724121#M10375

 

Never mind, I think I know the issue.

In thin client, the program can connect to the local PC therefore able to use C$ commands. When in DOS mode, the program is server-only, so C$ commands are useless.

What I probably need is the ftp command, and send files through IP address.


Robert Redekop
  • Participating Frequently
  • January 3, 2020

Never mind, I think I know the issue.

In thin client, the program can connect to the local PC therefore able to use C$ commands. When in DOS mode, the program is server-only, so C$ commands are useless.

What I probably need is the ftp command, and send files through IP address.

When in "dos mode" that presumably means you are running a windows runtime or a windows command-line runtime (or an older version and an actual msdos runtime).  With all of those you are running in windows peer-to-peer networking mode.  Your current machine will either be the server itself so you are operating locally, or your windows workstation would act as a client to access files on the server.

 

If you are using file sharing then you can use C$COPY, you just have to use X:\\path\\file to C:\\localpath\\localfile without the "@[DISPLAY]" string because that would only work with thin client.  The X: could be a different letter depending on how you set up the "shared drive".  A UNC name instead of X: might work, but I haven't tried it myself.