Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27192

VS 2010 Problems with batch files

$
0
0
Alright I have two questions.

This is the code I'm using.
It launches a batch file in a hidden window.

Code:

Dim AppData As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
...

Code:

        Dim procInfo As New ProcessStartInfo
        With procInfo
            .FileName = AppData & "\HXL\1GB.bat"
            .WindowStyle = ProcessWindowStyle.Hidden
        End With

        Process.Start(procInfo)

My first problem is that it "launches" the batch file from the location of my program. This sounds weird, but here is what I mean.
The batch file is written to access a file that is located next to it and then start it with certain parameters.
Unfortunately, when my program launches the bat, the bat looks for the file, but it looks for it next to the exe of my program instead of the batch file itself.

As long as I personally click on the batch file, everything is fine.

The same goes for my second problem. The batch file that I launch, launches an executable jar file with selected parameters.
When I have it launch the "1GB" batch, everything goes fine. But when I have it launch the "2GB" batch, nothing happens.
I don't get any errors or anything.

When I physically click on the "2GB" batch file myself, it launches just fine.
So with both problems, when I do it myself, it is fine. My program must be doing something wrong.


If you could help with either of these problems, that would be great! Thanks,



Hunter

Viewing all articles
Browse latest Browse all 27192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>