Calling A Java Class File From VB Via A Batch File?

Mar 15, 2012

I have a VB program that writes a batch file to allow me to run a line of the following format:java <my class file> [options]I then run the batch file using the Shell() routine in VB.When I do this it says it cannot find <my class file>. However if I run the same batch file from a dos prompt it works.why it works in a dos prompt but not in the Shell function?

View 1 Replies


ADVERTISEMENT

Calling Java Class In Vb?

May 18, 2009

In order to call a java class in vb, I found the following procedure and I tried.

(1) create a java class (eg: MyTest .java)

as
public class MyTest
{ public int myfunction(int value1, int value2) { return value1+value2; }

(2) compile to get a MyTest.class

(3)register Mytest.class using javareg.exe file from Microsoft SDK for Java using javareg /register /class:MyTest /progid:MyTest and see a MessageBox displayed with Succesfull register Class message

(4) copy MyTest.class to C:WinntJavaTrustlib

(5) open a New Project on Visual Basic. And paste this brief code on the Form Load event for example and run it. Set x = CreateObject("MyTest") MsgBox x.myfunction(1, 1)

I did all the above steps but when I run the vb program (Step 5), I get the error message "Cannot create ActiveX component". Unhandled Exception message.

I am using Java 1.5 and Visual Studio 2008.

View 8 Replies

.NET Multithreading / Calling Invoke On A UI Control From A Class In A Separate Class File?

May 13, 2011

Example:

Two files - TestClass.vb, myForm.vb

TestClass.vb looks as follows:

Imports System.Threading
Public Class TestClass
Private myClassThread As New Thread(AddressOf StartMyClassThread)

[code]....

The result:Application runs, no errors or exceptions.Displayed is the listbox and the Start button.I press the start button and a msgbox says "Not Invoked" as expected and upon clicking OK to that msgbox "Start Button Pressed" is added to the Output listbox control.Immediately following that the msgbox pops up again and says "Not Invoked". I was expecting "Invoked" as a separate thread is trying to use the Output listbox control.Of course this results in the Output.Items.Add being attempted which results in no visible result as the thread is not allowed to directly update the UI control.

View 1 Replies

Calling One Class File In Another?

Aug 5, 2010

<div sizcache="0" sizset="0">

i am having 2 class files a.vb and b.vb i have some public shared function in a.vb which i need to call in b.vb i have called it inthis way like the way i has called in normal .aspx pages in b.vb page i called the function of a.vb as

a.funcpwd("filedname") error BC30451: Name 'a' is not declared.
</div>

View 7 Replies

Import - Calling Class From Another File?

Apr 22, 2010

Lets say I have a class like this in class1.vb:

Public Class my_class
Public Sub my_sub()
Dim myvar as String
myvar = 10
Session("myvar") = myvar
End Sub
End Class

Then I have a ASP.NET page with a code-behind file, default.aspx and default.aspx.vb and I want to call my_class. I'm doing the following, but it doesn't work:

[Code]...

View 3 Replies

File I/O And Registry :: How To Batch File Input/out To Same Textbox

Feb 28, 2009

i am creating an app that when a button is pressed a batch file is executed and hidden from view.I have managed to get the output of the batch file to be displayed in a text box.

View 1 Replies

Read A Xml File From The Command Prompt Batch File

Apr 29, 2010

i need to read a xml file from the command prompt batch file.

View 4 Replies

Include A Batch File Or An .exe File In Setup?

Aug 31, 2010

How can I include a batch file or an .exe file in my setup, that runs after setup is complete?

View 2 Replies

Calling Java Base API's?

Aug 9, 2011

know about below queries,

1) How to Call Java base API's Through VB.Net 3.5

2) Is it a feasible approach to call Java API's through VB.Net as these 2 are different platform?

View 2 Replies

Calling Web Service With Java

Aug 25, 2010

What is the best solution (if any) for calling a vb.net web service with Java / JSP? If anyone could point me to any examples / references.

View 3 Replies

VS 2008 : Calling A Fortran .exe That Calls A File - File Not Found?

Jul 6, 2010

I am trying to run a fortran .exe in VB with the Shell() command. The fortran .exe, when ran, it asks you for a file name. It works perfectly on it's own, but when I try calling it through VB Shell(), it does not work.. (i.e. I cannot get VB to get the file name in it.)

Added info:I am using VB9 but I'm writing in compatibility to .NET. As for the Fortran .exe, when you call it, it opens a command window where it asks for a file name (which I got as a string in VB and I'm trying to pass it in), then you press Enter and it's done. Basically the .exe takes a text file and creates a new text file. We've also tried adding & mystring when calling the exe, but it gives a "file not found" error.

View 3 Replies

Run Batch File Using UNC?

Jun 21, 2011

I have been looking all day trying to find a way to do this. I need to run a Batch file which is held on a server, the file path begins with a IP Address which DOS doesn't like. So i found the pushd command which assigns a temp drive letter from which you can run the Batch File.If i was simply running a normal program or file i would use:

Dim proc As Process
proc = Process.Start("c:\BatchFile.bat")
proc.WaitForExit()

[code].....

View 3 Replies

Toogle Button Calling 2 Diffrent Batch Files?

May 11, 2012

I 'm trying to achieve is have 1 button that toggles between 2 batch files start/stop - when pressed the button calls for a batch file to start process - then if pressed again it calls for another batch file to stop the process. But it would be hand to have indicator or text on button stating the status.

View 1 Replies

Batch File Converter (PNG To BMP)

Dec 30, 2010

I am trying to create a program that renames files to 1 - (however many files are in the folder) and also convert .pngs to .bmps.

If RadioButton1.Checked = True Then
Dim files As String()
files = IO.Directory.GetFiles(TextBox1.Text)
Dim filepath_new As String
filepath_new = TextBox1.Text
For Each filepath As String In files
[Code] .....

View 7 Replies

Convert Batch File To Exe Using VB

Nov 9, 2009

how to convert batch file to exe using vb.net [Code] after i read the batch file but how can i save it as exe.

View 6 Replies

Convert Old Batch File To VB?

Sep 2, 2009

I have an old batch file i use that I would like to convert to vb.net,

The Batch file use a .reg entry to set the cleanmgr options. abnd then calls the sagerun command to run those options

I pretty sure I know how to create the registry entries what I am not sure to do is how to call the cleanmgr with the switches /dc /sagerun:200 then display a box saying it is complete and deleting the prefetch folder of anything older then 'n' days . [code]...

View 7 Replies

Get VB 2008 To Run A Batch File?

Oct 24, 2010

I need Visual Basic to run a batch file I have placed a batch file inside my startup application directory Inside the batch file I have WUinstall /install /reboot "When I double click the batch file it works perfect" Visual Basic 2008 Command Button I Have

Dim p As Process
Try
'instance a new process
p = New Process

[code]....

When I click this command button all I get is CMD window just flashes. When I hold down the enter key I can faintly read something about it is not an internal command.

View 14 Replies

Reading A Batch File?

Feb 15, 2012

I have a batch file that loads into a form containing 20 IT related incidents. I have managed to upload the batch file into a form. However I have an algorithm that reads an incident and manages to classify into its topic: See Below the data imported form the file:

1) Need to install jet direct to printers and connect users
2) Remove ms project software from PC 04384 and re install on 07882
3) install needed for 2 vectra software for Finance department PC assest 9875 and 8711
4) Supply PC 500 SITA Rest Area phone 2268 Asset and S/N
5) Add printer Epson label printer in ISD2
6) Remove Jetdirect and network printer via port PPSS PC add printer
7) Credentials for user UK15428 not logging onto the network
8) Install CD RW and unsupported software for UKX3395
9) Need Entire software installing on asset 5530, and access to password for use.
10) phone handset not functioning for UK10529, new phone required.
11) install card reader and software following PC move
12) New user group UKG0345 no mail just printers on PC00856 and PC02427
13) Update outlook remove project from PC D0186 in Prod Control per Tony Campbell install on Alisons PC in NDS
14) Unable to log onto the network, profile will need recreating
15) Remove spent toner cartridge
16) The printer doesnt appear to be printing, it looks like there could be a paper jam of some sort
17) Set up laptop and use local admin password to gain access to backup files
18) Remove image grabber card from PC and install on PC in paint shop have explained to user they will have to contact optivision

19) Cannot get onto network as I have forgotten my password, can you reset for UK15617
20) User cannot access voicemails, need mac address to edit on TOIP software

For example number 1) would be classified as a printer problem. I want the algorithm to be able to read each number, not the whole lot and classify the whole block of text, I want it to classify each incident individually, so there are 20 incidents to be classified.

View 16 Replies

Run Batch File In Program?

Feb 1, 2010

How can I run a batch from from within vb.net?

View 4 Replies

Sendkeys To Batch File?

Mar 3, 2012

if I press a button then it send keys to a opened batch file ...

I open batch file with this

Dim proces As String = folder.Text + "process.bat"
Process.Start(proces)

I want to send "stop" to process.bat. How I can do this ?

Or:

How I can close the process.bat when it is running ? I try with:

Public Sub KillProcess(ByVal processName As String)
On Error GoTo ErrHandler
Dim oWMI

[Code]....

View 1 Replies

Starting App From A Batch File?

Aug 5, 2010

I have written a simple folder backup program which, if started with a /s switch (argument), will run "silently" and perform an unattended backup. The obvious way to start the program with the /s switch is from a batch file, which then runs as a Windows Scheduled Task. I would like to create the batch file from the program itself, when it first runs, as it can then write the value of "Application.ExecutablePath" into the batch file follwed by the /s switch.

So, the question is, where best to save the batch file without running into Vista/Windows 7 permission problems? Is the local application data folder suitable?

Bear in mind there are three parts to this: my vb.net app needs first to create a batch file somewhere without permission issues, that batch file needs to be accessible to Windows Task Scheduler and then, when the batch file is run, it needs to start an .exe which is most likely in the "program files" folder.

View 3 Replies

.net - Launch Code That Would Normally Run From A Batch File?

Jul 14, 2011

It am trying to launch this code that would normally run from a batch file

Batch file code:

@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
"%ProgramFiles%Javajre6injava.exe" -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
PAUSE

[code]....

When I run the code cmd.exe opens but then nothing happens?

View 2 Replies

Batch File Input/out To Same Textbox?

Feb 28, 2009

i am creating an app that when a button is pressed a batch file is executed and hidden from view.I have managed to get the output of the batch file to be displayed in a text box.

View 6 Replies

Batch File Works When Ran Directly But Not From .Net?

Sep 2, 2009

Im running VB.Net 2005.Inside of the program I use the line ystem.Diagnostics.Process.Start("program_) to open multiple programs. For all but one of them this works perfectly. This erros when I try to run a batch file using. System.Diagnostics.Process.Start("C:xx.bat") the batch file opens but then throughs a number of unreconizable java errors follow.

[Code]...

View 2 Replies

Batch XML File - Tag Find And Replace

Mar 23, 2010

VB.net VS 2008

I need to develop a small application which can do a batch find and replace on all xml files within a folder. Example:

<cardHolderName>
<firstName>Geraldine</firstName>
<middleName>

[Code].....

I want to replace ALL <firstName) tags to John and all <lastName> tags to Smith to protect sensitive date. In addition, there will be other tags such as address, ss number and phoneNumber.

NOTE: There may be multiple instances of <firstName> within the file. 1000 xml files with all replacing names, address etc. with the same fixed name such as John Smith These will be used for testing and to prevent sensitive data from being leaked

There is no doubt that I can do this the long and dirty way. (I am working on).

View 1 Replies

Com Component Only When Run Via BackgroundWorker Or Batch File

Feb 25, 2010

My code is calling a COM component to retrieve data from a contact management product. That code works fine when called directly from my VB code. However, if I add a Progress dialog and run the SAME code via the BackgroundWorker, the COM component does not run. It generates an error: Object does not match target type. when attempting to access items from the COM component.

Also, if I run my application via a batch file that simply calls the application, the COM component does not run. In this case, it generates an exception as soon as the COM component is accessed in the code. I have posted questions to the COM component vendor but after several days have not gotten any responses. Someone told me I could not access COM objects on a thead, but the same BackgroundWorker code works when communicating with Outlook or Lotus Notes (which I believe are both COM).

[Code]...

View 4 Replies

Complicated Batch File That Would Like To Run In VB 2010?

May 8, 2011

I have an interesting project that i would like to complete. I have a batch file used to ping our locations. Has 1 simple input but i dont understand how to get this to work in visual basic 2010.

View 19 Replies

Execute A Batch File On Another Computer?

May 21, 2009

In vb.net 2008 I want to execute a batch file that resides on another computer. There is no error, but nothing happens. Here is the code:

[Code]...

View 3 Replies

How To Create And Run Batch File In Background

Jul 2, 2010

I have a fully running GUI of an application, but i want it to make a batch file and run it on the background.

View 18 Replies

Print Batch File In Program?

Dec 14, 2010

I have a text file that contains code for printing barcode labels.

code is in Zpl code,I want to print the labels using vb.net.[code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved