Accessing a DOS shared directory in UV

168 views
Skip to first unread message

Rick Weiser

unread,
Jun 4, 2024, 11:12:19 AMJun 4
to Pick and MultiValue Databases
Hi Guys,

I have a mapped windows drive. I need to programmatically copy items from the UV server to another server. The directory is accessible from the UV server but not from UV itself.

If I execute DOS from tcl, I can use the following:

 net use I: UNCPath *user* /user:*password*

I can then access the "I" drive from a Basic program.

I know how to set the net use in D3 (via user-coldstart) but how can I set this up for UV/Windows so that it sees the mapped drive?

Thanks,

Rick

Brian Speirs

unread,
Jun 4, 2024, 4:11:58 PMJun 4
to Pick and MultiValue Databases
I'm not sure I totally follow your example, but let's explain what we do (with QM - but it worked in UV when we used that).

We have a C:\Temp folder on the server. This folder is mapped to drive U: for access by users outside the server.

In the VOC of each account, we have an item named TEMPDIR that looks like this:

    F
    C:\Temp
    D_VOC

UV needs a dictionary defined, but QM doesnt'. We actually point the dictionary elsewhere - but you choose which dictionary you want to use.

You can now query what is in the temp folder with:  LIST TEMPDIR

Internally, we can OPEN the temp folder using:  OPEN 'TEMPDIR' TO fp.temp ELSE ...
OR, we could use OPENPATH

Looking back at your question, I note that you are referring to both D3 and UV - which is confusing. Also, our mapped drives are set up outside the MV environment so that the users can use them - I think that is done in the Windows logon. Internally, the MV server is simply accessing a folder on the server so there is no "mapping" going on there. But each server can access the shared drives on other servers like this:

    sh dir \\server2\temp

I hope that helps.

Brian

Bill H

unread,
Jun 4, 2024, 4:30:50 PMJun 4
to mvd...@googlegroups.com
Rick:

In UD, which I assume is very similar to UV, when a directory is shared on the UD server I can access it from UD by creating a (VOC) entry that looks like:

2 Dev (0)-> AE VOC EMAILFILE
Top of "EMAILFILE" in "VOC", 3 lines, 36 character
*--: P
001: DIR
002: C:\inetpub\mailroot\Pickup
003: D_VOC
Bottom.

When a directory is shared from another network server I can access it from UD by creating a (VOC) entry that looks like:

2 Dev (0)-> AE VOC DWHELP
Top of "DWHELP" in "VOC", 3 lines, 37 characters.
*--: P
001: DIR
002: \\MyWebServer\advantos\help
003: D_VOC
Bottom.

I'm using a machine name here, which is in the "hosts" file.  I can also use the IP address, e.g.



--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/5808823e-188d-4748-bd82-3353a0fa8b24n%40googlegroups.com.

Rick Weiser

unread,
Jun 9, 2024, 4:57:25 PMJun 9
to Pick and MultiValue Databases
Guys,

I don't want to access the directory from withing UV. I want to execute a DOS program.

For example, one thing I need to do is generate barcodes and store them on another server (non-pick). I have already found a tool for this but UV does not see the mapped drive (even tried the full UNC path).

Like I stated previously, if I open a telnet session in UV, go to DOS (by typing DOS), I can execute "net use ..." and then the third party tool works. How do I get UV to recognize the mapped drive.

Thank,

Rick

Scott Ballinger

unread,
Jun 9, 2024, 7:25:23 PMJun 9
to Pick and MultiValue Databases
Rick, the way I typically do that is to execute the DOS program associated (registered?) with a file type from my PC using Accuterm, i.e.

     cmd = esc:stx:"<":file.path:cr
     print cmd:

Where file.path is the unc path to the file (or typically faster to use a mapped drive on my PC), e.g. a PDF, but should also work for an EXE.

Note "<" opens a new window running the program associated with "file" and allows the Accuterm session to continue, use ">" to suspend the Accuterm session until the DOS program window is closed.

The advantage here is that the UV system does not need to know the path to your program (but your PC does).
Obviously it doesn't work from a Telnet session running on the UV Windows server to itself, but typically I use Accuterm on the client PCs to connect to the UV host, whether Windows or Linux. The only difference between the Windows version and the Linux version is "\" vs "/" in the path.

Here is the Accuterm documentation:

AccuTerm Programming

External Program Execution

ESC STX < command CR

Executes the Windows command line command, then returns to AccuTerm emulation mode immediately.  Command is executed concurrently with the terminal session. Command may also be the file name of a document that is registered with Windows. If command is a document file name, the program associated with the specified file is used to open the file. For example, if the file name ends in ".doc", Microsoft Word is used to open the specified document file. You can also use this function to open a URL in the default browser (be sure to include the http:// prefix in the URL):

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
CMD = "calc.exe"
PRINT ESC:STX:'<':CMD:CR:

 

ESC STX > command CR

Executes the Windows command line command and suspends the terminal session until the command completes. See above for details.

Note: when using this function, you often need the host program to wait until the command terminates. If you require this functionality, then you should send the ESC STX I command immediately following the ESC STX > command, and then wait for input. AccuTerm will not process the ESC STX I until the command terminates. After the command completes, ESC STX I transmits AccuTerm's licensing information back to the host, thus the input is satisfied and the host program can continue execution:

EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13)
CMD = "notepad.exe"
PRINT ESC:STX:'>':CMD:CR:
PRINT ESC:STX:'I':
INPUT JUNK

 

/Scott Ballinger

Rick Weiser

unread,
Jun 9, 2024, 9:07:44 PMJun 9
to Pick and MultiValue Databases
Hi Scott,

Sorry, not using AccuTerm.

Brian Speirs

unread,
Jun 10, 2024, 4:29:15 PMJun 10
to Pick and MultiValue Databases
OK. So the issue is that you want to start a program from UV, and you want the program to be able to see the mapped drive?

My guess (from your descriptions so far) is that when you execute a DOS shell, that DOS shell does not inherit the mapped drive that you have established for UV. So the DOS program does not see any mapped drive.

In that case, the best thing to do is write a batch file that: (a) runs the net use command to establish the mapped drive for the DOS shell; (b) runs your DOS program. Then from UV, you can execute the DOS command to run the batch file. Finally, you might want to delete the batch file.

HTH,

Brian

Bruce QB

unread,
Jun 10, 2024, 4:51:35 PMJun 10
to mvd...@googlegroups.com
Can data variables be passed between the Win.exe and the Accuterm session?  Eg. Send in Filename, return selection to Accuterm.

Scott Ballinger

unread,
Jun 10, 2024, 11:00:15 PMJun 10
to Pick and MultiValue Databases
Using the       ESC STX > command CR

version, if "command" outputs a string, then the calling program can wait on an input to get the passed string.

Steven Martin Trimble

unread,
Jun 11, 2024, 9:29:48 AMJun 11
to mvd...@googlegroups.com
When using AccuTerm, here is a little bit simpler way:

* use AccuTerm file transfer
   WINDOW$PATH = "c:\reports\"
   CMD        = WINDOW$PATH:ALLINV.ID
   SEND.PATH  = WINDOW$PATH
   SEND.FILE  = ALLINV.ID
   SEND.DATA  = ALLINVOICES
   GET.PATH   = ''
   GET.FILE   = ''
   GET.DATA   = ''
   CALL DOSSVC(CMD, SEND.PATH, SEND.FILE, SEND.DATA, GET.PATH, GET.FILE, GET.DATA)
   PROMPT ""

-----------------------------------------------------------------------

looking at AccuTerm FTBP DOSSVC code, you will find explanations for the above variables.

* INPUT:
*   CMD       = DOS COMMAND TO EXECUTE
*   SEND.PATH = DOS DIRECTORY TO SEND SEND.DATA TO BEFORE CMD
*   SEND.FILE = DOS FILE NAME TO SEND SEND.DATA TO BEFORE CMD
*   SEND.DATA = DATA TO SEND TO SEND.FILE
*   GET.PATH  = DOS DIRECTORY TO GET GET.DATA FROM AFTER CMD
*   GET.FILE  = DOS FILE NAME TO GET GET.DATA FROM AFTER CMD
*
* OUTPUT:
*   GET.DATA  = DATA RECEIVED FROM GET.FILE
*
* NOTE: SEND.DATA AND GET.DATA MUST BE DIFFERENT VARIABLES!

If the Windows workstation recognizes the file extension, the appropriate application will open the file. I love to write reports in HTML and let the browser do the printing to the 'Printer' or 'Save as PDF'. Excel should recognize a .csv file and open it.
Fun stuff.

CDMI
Steven Trimble
(501) 772-3450 cell/text


Rick Weiser

unread,
Jun 20, 2024, 1:35:20 PMJun 20
to Pick and MultiValue Databases
Guys,

I am not using AccuTerm.

This is a Browser application and the access to DOS is via a Basic program.

I hope this clears this up.

Rick

Brett Callacher

unread,
Jun 22, 2024, 7:09:21 AMJun 22
to Pick and MultiValue Databases
Would suggest using the full UNC path, rather than relying on a mapping, for this.  Then give the logged on user necessary file permissions and you should be good to go!

Jim Idle

unread,
Jun 22, 2024, 10:11:28 AMJun 22
to mvd...@googlegroups.com
Rick,

The older APIs do not support UNC file paths, and that is what the CMD program uses. They can't really change the behavior. So there are two ways:

Use push and poopd:

PUSHD //Rick/rick/rick

Do your file stuff

POPD

Use the powershell, which supports network mounts.


Push creates a temporary mount for you. Powershell supports the 'new' APIS. 


Jim

Reply all
Reply to author
Forward
0 new messages