Saved Bookmarks
| 1. |
Solve : Dos Command Help for MD, XCopy and Redirectors? |
|
Answer» HI everyone, I am a beginner, and I am trying to use MD in MS-prompt to create a folder in a server from my Win XP workstation and use Xcopy to copy some files to that folder. However, I want to redirect the MD and Xcopy command to another window for the name of that folder. Should I use the Redirectors to accomplish this? My guess is to somehow redirect the MD and XCopy to a text file to retrieve the name for the new folder. Is this correct? What is the correct syntax to type for this purpose? I had tried MD \\servername\ < name.txt and Xcopy e: \\servername\ < name.txt. Both of these failed. I appreciate all your help for this!This is more geared towards the DOS Forum...so it might get moved there. Here is a partial answer: From Batch from what I think I understand you are trying to do, you can not copy data from one DOS-Shell Window to another or grab info from the other window with Batch. You can use macros to do this, but that over complicates things since you would either have to PROGRAM it all as a macro if the routine and data in it is static or if you need some user interface with it to enter any non static information you will have to have your batch run, trigger the macro to interface with the GUI, then after that (keyboard/mouse) macro terminates pick up in the batch where it left off. Only exception to interfacing to other windows from your Batch running in the DOS-Shell is if you can interface with it BEHIND the scenes via the PID for that Window. But you would likely need 3rd party tools to interface enough with that other window to grab data from it. That is an area that I havent tinkered much with other than for admin purposes of killing windows etc via the PID. But the PID can be used as a reference pointer to that other window and if you can reference to it to that extent you may also be able to use that as a address for routines to grab data from it by a 3rd part tool or use of a PROGRAMMING language like C++ to interface with the memory address of that window to search and extract data from it...VERY COMPLICATED and not sure if that would exactly work, but theoretically it should. For getting data from a server, I would personally create a mapped drive to that server and use that to run your XCOPY so that your XCOPY is to driveletter:\path\file vs \\servername\path\file etc. I'd use the NET USE command to MAP the drive letter and use a drive letter like Z:\ with is not likely to stomp ontop of any other drives when mounting. More info on what you are trying to do might help us all aid you better Hi DaveLembke, Thank you for your help! I had mapped the drive as you have suggested. However, I just want to be able to change the name of the folder from a simple text file. Using a third party tool just for that seems to be too complicated for me. I am trying to do this because I want to let my coworkers who are not familiar with the Dos interface to simply type the name of the new folder without going into Dos. Is there any other way to do this? |
|