Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello I need a way to write to files NOT using a filestream. Is there such a way in VB9? And when I'm at it, how do I (in vb9) execute a commandline program with syntaxes of my choice(maybe input from textboxes) without writing a batch file and executing it?
Live the life as you know it
/ Wille

Is there such a way in VB9?
Not that I know of. I suppose you could use ActiveX's Scripting.FileSystemObject. Any reason FileStream is insufficient?how do I (in vb9) execute a commandline program with syntaxes of my choice without writing a batch file and executing it?
I'm not sure what you mean; if you can run a Command Script from your program, what's keeping you from running a program?

Well I've been using VB9 to make a nice interface and stuff but then a commandline program to compress files. This program then (in the VB part) takes information from the user and then via a filestream writes batchfiles and executes them. These batchfiles contain the information from the user in syntaxes for the commandline program.
This however, I've noticed, is very unstable. The filestream doesn't write the files correctly. The files will be readable in notepad or any other similar program ofc, but the commandprompt detects like hidden characters or something. I don't know if it's the filestream but I think that's the best place to start. But if there's a way to execute this commandline program with the certain syntaxes without having to use a filestream and batchfiles, it would make it so much easier.
What I meen with "execute this commandline program with the certain syntaxes" is that I can use the shell command like this:
Shell("compress.exe")
That would only execute the compress.exe which would probably close since it don't know which files to compress. If I could call compress.exe like this:
shell("compress -b "archivename" "file1" "file2")
then it would be much easier.
Hope this clearyfies everything.Live the life as you know it
/ Wille

the commandprompt detects like hidden characters or something
You're opening the file as UTF; you need to be using ASCII.If I could call compress.exe like this:
shell("compress -b "archivename" "file1" "file2")
then it would be much easier.
There shouldn't be any reason you can't.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |