Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Rickles

3107 posts

Uber Geek
+1 received by user: 445

Trusted

#138597 10-Jan-2014 09:13
Send private message

It's been many years since I've created BAT files to run on Windows machines, and encountered a small problem. I have two BAT files that utilise Android and Java apps, and they both run when executed separately.  Putting them both in one BAT file (so that they execute sequentially) runs into problems ... I'm sure it's something simple but can't pin it down.

The files/lines are -

START C:\Development\adt-bundle-windows-x86-20130917\sdk\platform-tools\adb.exe shell

and

START C:\androidscreencast(1).jnlp

As I say, both work individually, but not together ... tried putting second line in same directory as first, and also a CHDIR to ensure second line points to C; drive.

Error says "Windows cannot find C:\androidscreencast(1).jnlp ... "

Any clues, suggestions would be welcomed.

R.


Create new topic
gehenna
8667 posts

Uber Geek
+1 received by user: 3883

Moderator
Trusted
Lifetime subscriber

  #964292 10-Jan-2014 09:18
Send private message

Why not create a batch that calls both other back files, rather than one batch that calls both executables, e.g:

@echo off
call \path\batch1.bat
call \path\batch2.bat

edit: bearing in mind I haven't written a batch file in 17 years :)



Rickles

3107 posts

Uber Geek
+1 received by user: 445

Trusted

  #964301 10-Jan-2014 09:24
Send private message

Hi Michael, yeah, I'm in the same boat and went up into the attic to find my copy of DOS 5 to recall basic commands .

Will try your suggestion though.

R.

andrewNZ
2487 posts

Uber Geek
+1 received by user: 1461
Inactive user


  #964305 10-Jan-2014 09:33
Send private message

Does the second one need to be run after the first has completed loading?

I thought the start command instantly moved on. Maybe add a 3 second pause

START C:\Development\adt-bundle-windows-x86-20130917\sdk\platform-tools\adb.exe shell
ping 1.1.1.1 -n 1 -w 3000 > nul
START C:\androidscreencast(1).jnlp



Rickles

3107 posts

Uber Geek
+1 received by user: 445

Trusted

  #964314 10-Jan-2014 09:45
Send private message

Andrew ... a time pause may be an idea, will give it a go .

R.

Rickles

3107 posts

Uber Geek
+1 received by user: 445

Trusted

  #964541 10-Jan-2014 14:07
Send private message

UPDATE: Thanks people, the short pause was enough to allow the first executable to open and stabilise before being hit with another command ... in fact the pause need only be 1.5 seconds .

Cheers,

R.

Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.