View Full Version : Pulling information from a DOS window into a projector file?

03 March 2003, 04:19 PM
Hi there,

I have created a flash document that I have created and saved as a projector file (.exe file) so that a flash player is not needed. What I have done with this is set up a basic troubleshooting flie for local computer users to be able to troubleshoot there own pc by selecting a button wich calls on a batch file via the fscommand folder.

Basically the batch file is doing nothing more than pinging a server or starting the IPCONFIG command via the DOS prompt.

Just wondering if anybody knows how to pull the information that is generated in the DOS window into the projector itself?

Any help would be greatly appreciated.


PS if some one needs me to attach a .zip file with the exe file so you can better understand what I need just let me know.

03 March 2003, 12:49 PM
I don't know if it will work, but you can try the following.

Any DOS command output can be written to a text file, using '>> textfile.txt' behind it, so try 'ipconfig >> c:\ip.txt'. You can then try to read the text file from Flash. I guess you best work with a timer then, to give the DOS commands the time they need to execute.

I haven't tried it, so I don't know if it works. Let me know if it does :)

03 March 2003, 02:50 PM
Thanks for the feedback! I will try this now and get back to you.

Thanks for the idea though cause I wasn't thinking about righting to a text file :-)

03 March 2003, 01:41 PM
and to add to what xilver said (cus thats my thoughts aswell)

Maybe find a temp directory so the user doesnt have that 1 file cluttering their space, aswell as confusing them "Ip.txt"? whats that oh my ive been hacked!
(ok thats a little excessive :p)

btw, i also thought of this

if your actionscript can open a dos window, can it open it witha name... kinda like javascript?

and from that, you just ask the actionscript to search or retreive maybe a line, a word, or something?

if im not making sense forget about it :-)

03 March 2003, 01:09 PM
To prevent the timer problem, the batch file could also execute the Flash projector in the end.
But I don't think that this approach is a good idea at all. First of all, the output of the DOS command could be changed with the release of a future Windows version. Second of all, Microsoft still tries to get rid of the DOS box. It would be better when a Windows-based program fetches these information and generates the file or (as far it is possible) passes it to the flash projector in a different way, maybe command line, but I don't know... :shrug:

03 March 2003, 04:52 PM
Thanks for the responses guys. sorry it took so long for the response as I was trying to get my batch files working right.

OK so I ended up having the batch file wright the output to a text file via >> so this would append the information and not create a new text file over top (needed to do this to keep the &example=) of the already existing one.

Then I have created a button lets say on the start scene. After doing this I have the button launch the .bat file and go to a new scene at the same time. I have set this up where frame 1 reads the variables. at frame 3 I have it set to keep going back and playing frame 1 of the same scene.

Then I have created a next button that launches another batch file that will copy the original file back over this.

If you guys want to see teh fla file just let me know and i will send it to you.

thanks again!

03 March 2003, 08:27 AM
another quick question..

any ideas how to keep flash from putting extra lines in my text fields when reading from the text file? for instance I am getting this in a text file
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 1XX.XXX.XX.XX
Subnet Mask . . . . . . . . . . . :
Default Gateway . . . . . . . . . : 1XX.XXX.XX.X
But it is showing up like this
Connection-specific DNS Suffix . :

IP Address. . . . . . . . . . . . : 1XX.XXX.XX.XX

Subnet Mask . . . . . . . . . . . :

Default Gateway . . . . . . . . . : 1XX.XXX.XX.X

Any help that you could offer on this would be greatly appreciated.

03 March 2003, 02:12 PM
It was pretty common in the DOS era to use two ASCII characters for a line break. These characters are 0D and 0A - both in hexadecimal. I also created such a dump to look at these characters. Seems like the 0D character is dumped twice by the DOS command. One line break consists of 0D 0D 0A as created by the ipconfig command. And Flash inpterpretes that as a double line break. You could skip the empty lines in your script :shrug:

03 March 2003, 08:12 AM
Can you send me your file? I can take a look at it and see what I can come up with. I don't know who your intended "user" will be and how much you can install on their systems, but I would recommend installing Perl. Perl excels at manipulating text, and you could easily remove the extra line breaks with it.

I just noticed that if you use the > to create your file, you get those extra line breaks. Try doing it this way:

ipconfig /Batch myIP.txt
or use this for a little more information:

ipconfig /All /Batch myIP.txt

CGTalk Moderation
01 January 2006, 03:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.