Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 3:08 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Redirecting DOS Program Output
PostPosted: March 23rd, 2010, 7:35 pm 
Offline

Joined: June 1st, 2008, 1:51 pm
Posts: 5
Hello,
I have been challenged to create a system analysis program, which collects data from a load of DOS (command line based) tools and dumps them into different files, which the Opus program runs in order, and another program then generates a report file from the results.

Now, in the old days of MS-DOS, if you put "> output.txt" on the end of a command, the command output would be rerouted to that file. It still works if you use the cmd.exe in Windows XP/Vista/7. I can therefore capture the data when I run the command from the command line, but as soon as I try the same from Opus it fails to work.

Here is a section of the Opuscript code I use to run the tool:

var Fname = SYSTEM_PUBLICATION_DIR + "tree.com"
var Params = "c:\ /f /a > " + SYSTEM_PUBLICATION_DIR + "\output\listc.txt"
LaunchFile(Fname,Params)

However, when it runs, no output is written to the file. I have tried different filenames, using the system built tree.com, but to no avail. However, as soon as I remove the redirection bit, it runs fine!

Any ideas?

Sorry if it seems unclear, just ask and i'll put more info up.

Ben.

(Opus Pro v6.3 - Windows 7 RTM x86)


For this message beninjam has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: March 23rd, 2010, 7:58 pm 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
You'll need to run it through cmd.exe. So something like:

Code:
var Fname = SYSTEM_WINSYSDIR + "cmd.exe"
var Params = SYSTEM_PUBLICATION_DIR + "tree.com c:\ /f /a > " + SYSTEM_PUBLICATION_DIR + "\output\listc.txt"
LaunchFile(Fname,Params)


For this message Dave Emberton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: March 23rd, 2010, 8:23 pm 
Offline

Joined: June 1st, 2008, 1:51 pm
Posts: 5
Hmm, tried that, and I get a command window up fine, but then the tree.com file runs, but the output still isn't redirected to the text file

Ben.


For this message beninjam has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: March 23rd, 2010, 9:08 pm 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
I missed out the /c

Code:
var Fname = SYSTEM_WINSYS_DIR + "cmd.exe"
var Params = "/c " + SYSTEM_PUBLICATION_DIR + "tree.com c:\ /f /a > " + SYSTEM_PUBLICATION_DIR + "\output\listc.txt"
LaunchFile(Fname,Params)


Is tree.com in your system publication dir? When I replaced that with just tree (built into Windows) it worked and I got the redirected output.

Also spaces in SYSTEM_PUBLICATION_DIR will make a mess of this.


For this message Dave Emberton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Redirecting DOS Program Output
PostPosted: July 18th, 2010, 6:29 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Doesn't look like you can call cmd.exe within Windows 7 64-bit

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Redirecting DOS Program Output
PostPosted: July 19th, 2010, 11:05 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Yes, it does.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : lmc


Top
 Profile Visit website  
 
 Post subject: Re: Redirecting DOS Program Output
PostPosted: July 19th, 2010, 5:22 pm 
Offline

Joined: May 25th, 2008, 4:57 pm
Posts: 355
Location: Ireland
Opus: Pro 9.75
OS: Windows 10
System: MacBook Pro (Intel 2020)
Sorry, indeed it does open. It starts the 32-bit version of cmd.exe

_________________
Opus Pro 9.75 on MacBookPro (2020 Intel) running Parallels 19 with Windows 10 (x64)


For this message lmc has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group