(VB6 & DOS) I have a batch file but I would rather have the VB interface.
I'm not to sure how this batch file works (basicly it is contacting another co's server and transfering files) but I believe it is through java. I control it via the command window. Will it be hard or even possible to convert to vb?
Code:
echo off
rem set JDK_BIN=D:\jdk\bin\
SET CLASSPATH=D:\blahxf\java;D:\Blahxf\lib\email.jar;D:\Blahxf\lib\jnet.jar;D:\Blahxf\lib\foo.jar
SET CLASSPATH=%CLASSPATH%;D:\Blahxf\lib\jsse.jar;D:\Blahxf\lib\jcert.jar
JAVA -Xms8M com.Blah.interfaces.pms1way.BlahClient -S Y
Thanks
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
Just the batch... the batch and the java are from a different company and they may change something one day and assume I am just switching out the files.
I would even be happy with opening the batch file in a 'window' on a form kind of like a WebBrowser element.
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
If you just want to run the batch file you could use the Shell command on it. Or use ShellExecute if you want it to finish before you continue your program.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
What this program is, is basicly a holder for an asp page that it refreshes every 30 seconds and hopefully will run or hold the batch file (that executes every 60 seconds on its own) so I guess the "Shell" method is what I am looking for... could you elaborate a bit on that or point me in the right direction?
thx
ms
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
It takes the two arguments, the app to run, this can be a bat file with command line arguments if you wish, and the second argument is how to run it, Hidden, Normal, Maximised, etc.
If you want more information check out the microsoft website.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
I don't know of any control you can use to use a batch file like a webpage. The only thing i can suggest is looking into setting the size and position of the command window using API's.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
Recently I came across a nice VB Class module that executes a DOS command and captures the output to any control (textbox / label) that you like. The good thing about it is that it uses the API to execute the DOS command and therefore you don't get the DOS window - the whole process is invisible.
I use it to read the EXIF data from digital camera files, because the program I have to extract the data is a command line program only.
If you want it let me know and I will post it for you.
Some days you're the dog,
and some days you're the hydrant.
Originally posted by PhilRob56 Recently I came across a nice VB Class module that executes a DOS command and captures the output to any control (textbox / label) that you like. The good thing about it is that it uses the API to execute the DOS command and therefore you don't get the DOS window - the whole process is invisible.
I use it to read the EXIF data from digital camera files, because the program I have to extract the data is a command line program only.
If you want it let me know and I will post it for you.
that sounds like what I am looking for... I was just explaining it poorly when I used the webbrowser as an example I should have though about the text box.
post please
thanks
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
After re-reading the code i was posting, it was to run .exe files and pipe the output to a vb textbox or label or whatever. It works with things like ipconfig.exe or ping.exe etc, but i don't think it works with batch files, so i didn't want to confuse the issue
(and i'd have got away with it if it hadn't been for you pesky kids )
Originally posted by PhilRob56 Here it is!
The code originally came from Planet Source Code, so I take no credit at all. I will say that it works, and does a good job.
Awesome, thanks for finding that. Quick question though (I really only need to turn my batch file on and off so am going to get rid of the command line and replace w/on off buttons. When it is in the command window I hit ctrl+c to turn it on and off (or just call it to turn on). how would I do via this program?
Originally posted by chicocouk msimmons, yeah I did, sorry
After re-reading the code i was posting, it was to run .exe files and pipe the output to a vb textbox or label or whatever. It works with things like ipconfig.exe or ping.exe etc, but i don't think it works with batch files, so i didn't want to confuse the issue
(and i'd have got away with it if it hadn't been for you pesky kids )
No problem... I guess i got to it before you deleted it (and the code didn;t seem to work for me) when I cam back to reply/ask it was gone
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
yeah but if I need to kill it I normaly hit ctrl+c then I can just ctrl+c to restart it... I guess I can just send the VB app a different command to clear the batch file out then reload it when ready.
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
I made all the adjustments I needed to (decided to forgo the ctrl+c part. we can just kill the app when needed). It runs fine on my NT4.0 machine but the final destination is my Win2K server. When i click the exe to start it nothing happens. (it gets added to the task manger but the form never loads.) Is there some adjustment that needs to be made between the two OS's?
thanks
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
the batch file is in a directory on d: and has to be there (I may be able to fix it if I have to but wont be fun ) and I believe the exe has to be in the root of c:. easy right just do this:
d:
cd theDirectory
theBatch.bat
but the d: (and anything but "help" or the batch name) gives the error:
File or command not found.
any ideas?
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
Sorry, I mised your last question.
I am using it to execute a DOS Executable with Command Line options.
When I first tested it the executable was in my Path variable (tested on Win2K), so it was not a problem. On my XP machine at home, after installing it into my project, I decided not to rely on the executable being in the path and specified the full path to the exectable.
So....to cut a long story short....I wrapped the command string in quotes..
String = """" & whatever & """"
Should help (I hope).
Some days you're the dog,
and some days you're the hydrant.
and it will run but it has its own error cos it cannot find the files it needs (I may have to just edit it but won't be fun)
OR
I wote a batch file containg this:
Code:
d:
cd theDirectory
theBatch.bat
now if I run that batch file from the command window it works perfectly but in the program I have the problem where the exe will show up in the task manager but not really run.
thanks for all the help
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
I tried that just now and got the same (command not found) error on each of these lines:
Code:
rem set JDK_BIN=D:\jdk\bin\
SET CLASSPATH=D:\blahxf\java;D:\Blahxf\lib\email.jar;D:\Blahxf\lib\jnet.jar;D:\Blahxf\lib\foo.jar
SET CLASSPATH=%CLASSPATH%;D:\Blahxf\lib\jsse.jar;D:\Blahxf\lib\jcert.jar
but on this line
Code:
JAVA -Xms8M com.Blah.interfaces.pms1way.BlahClient -S Y
i get the same error that i get when i run the batch directly from the exe with the full path:
java.lang.NoClassDefFoundError: com/synxis/interfaces/pms1way/SrmsPms1WayClient
Exception in thread "main"
and i am assuming this is caused by somthing in the company's code that wrote the batch file and it cannot find the files it needs cos it is running in c:
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
I just ran the batch with the full path again and this is the error I get:
C:\>echo off
SrmsPms1WayClient initialized at Tue Nov 05 14:47:34 CST 2002
SrmsPMSSettings.properties not found! Using default values.
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.bLaH.interfaces.pms1way.SrmsPMSSettings.getServerPort(SrmsPMSSettings.java:163)
at com.bLaH.interfaces.pms1way.SrmsPMSSettings.setupUrl(SrmsPMSSettings.java:387)
at com.bLaH.interfaces.pms1way.SrmsPMSSettings.<init>(SrmsPMSSettings.java:87)
at com.bLaH.interfaces.pms1way.SrmsPms1WayClient.main(SrmsPms1WayClient.java:89)
Exception in thread "main"
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.