Why vbscript calling bat file calling java program won't work in Windows 7?

By DaleSprague ·
I have a bat file that calls a java program which transfers some files to another server and then deletes the files that were just transferred from my local machine. This works great in XP and in Windows 7 when I run the bat file myself. I'm set up as an administrator on my machine and I have UAC at the lowest level on this machine.

I had a tech/automation specialist write a vbscript that we use in QuickTestPro that will move some files to the proper transfer directory to be transferred then the vbscript uses to call this bat file so that we can transfer the files. The script is farily simple and is shown below.

Set objWSHShell=CreateObject("")
objWSHShell.Run strBatchCall, 1, True
Set objWSHShell=Nothing

strBatchCall is merely the full path and file name of the bat file that I want to call.

When the tech wrote this she was on a Windows XP machine and the script worked just fine. When I try to run it on my Windows 7 machine it won't work. The bat file is called and every command in the script that is not related to the calling of the Java program works.

The call of the java program is fairly simple and as I said works when running as administrator just fine but doesn't work when called this way.

java -jar myClient.jar -upld ".*"

Anyone have any thoughts or ideas. This is pretty crucial to an automation effort that has to occur.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

I think you need to raise the rights

by markp24 In reply to Why vbscript calling bat ...


you may want to try disablng the UAC on the windows 7 pc (reboot is needed) then try it, if it works then you knwo its a UAC thing.
Also try elevating the script privilegde to administrator.
that link has some information on doing that for vista.

Collapse -

The solution was a little more involved than that

by DaleSprague In reply to Why vbscript calling bat ...

We finally solved this issue and here is what we had to do.

1. By putting pauses in the .bat file we could see the messages displayed.
2. First we were able to determine that the script didn't recognize Java even though the 64 bit version JRE 1.6 was installed.
3. Based on previous experience, we guessed that QTP was looking for the 32 bit version of Java, so we loaded the 32 bit version and changed our Java environment paramters to point at the 32 bit version.
4. We knew we were getting somewhere because we were now getting different messages when we ran our test and eventually we got it right by adding a "cd C:mydirectory" in the bat file. The bat file ran by itself manually didn't need this because all of the property files etc. were contained within the directory I was running it from but when calling it from QTP and this vbscript, it was looking for property files in a program files/QTP/bin directory.

Thanks for the response though. That may help me with another problem we are having.

Back to Networks Forum
3 total posts (Page 1 of 1)  

Hardware Forums