MD commands using Suspend (AREV Specific)
At 04 FEB 2000 10:47:45AM Dale Walker (MagCorp) wrote:
I just would like a bit of clarification concerning SUSPEND.
The problem is that I would like to embed within AREV a PCPERFORM or SUSPEND a command that will go to a network drive letter and create a folder (directory) based on the date of the report and then print a report to that directory.
I can print a report to the directory using PDISK but I need to create the directory automatically. If I use SUSPEND twice as follows it doesn't work
SUSPEND "C:"
SUSPEND "CD\"
SUSPEND "MD TEST"
The above doesnt work because it goes out to the default \winnt directory.
Ideas, suggestions, insights will be greatly appreciated.
Thanks,
Dale
At 04 FEB 2000 11:24AM WinWin/Revelation Support wrote:
Dale:
Try writing a batch file then running the batch file
e.g.
equ CRLF$ to \0D0A\
filename=myfile.bat'
cmd='
cmd=C:'
cmd=MD \TEST'
convert @fm to CRLF$ in cmd
oswrite cmd on filename
if status() then
call msg('Error writing batch file','','','')end else
perform 'SUSPEND EXIT ':filenameend
Hope this helps
Bob CartenWinWin Solutions
At 04 FEB 2000 11:25AM Victor Engel wrote:
Each time you suspend you start out at the same location. I suggest you use only one suspend and MD the fully qualified directory. Using your example:
SUSPEND "MD C:\":TEST
TEST would be a variable containing the directory name.
There's no need for you to be logged to the parent of the directory you wish to create. You can create a directory logged from any location.
At 04 FEB 2000 11:25AM Dba wrote:
Create a BAT file executing all the three lines and suspend and call the bat file.
At 04 FEB 2000 12:39PM Matt Sorrell wrote:
Dale,
One other option that you have, which also applies anytime you want to execute multiple DOS commands, is to PIPE the commands together. In your case, the command would look like this:
SUSPEND C: | CD\ | MD TEST
I have used this successfully in a number of applications where I didn't want to mess with creating a batch file. I believe there is a limitation on the number of commands and/or length of the command, but for short items it works wonderfully.
Matt Sorrell