Could anyone please tell me how i write a batch file (.bat) to open 2
programs, the first to open immediately and the second one with a 20
second delay after the first one ??
for example:
I want to open Google Earth first (on my PC it is : C:\Program
Files\Google\Google Earth Pro\googleearth.exe)
Then i want to open another program (Event Manager) 20 seconds after
Google Earth (this program is at C:\Documents and
Settings\Andrew\Desktop\DUMP\EventManager\EventManager.exe on my PC)
I have tried, but i cannot get it to work.
Best Regards,
Andrew
---example.bat--
start first.exe
start /wait myscript.vbs
start second.exe
--end file--
--myscript.vbs
wscript.sleep 20000
--end file--
--
Mark L. Ferguson
e-mail subject line must include "QZ" or it's deleted
.
"Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
news:cKvha1HhABxci...@apple100.NOSPAMfreeserve.co.uk...
; Delay.au3
; Compile with AutoIt 3.x, http://www.autoitscript.com
; Usage in batch: Delay {seconds}
Opt ("TrayIconHide",1)
if $cmd[0] > 0 then
$thisDelay=$cmd[1] * 1000
sleep($thisDelay)
endif
exit
Best Regards,
Andrew
Mark L. Ferguson:
start first.exe
echo wscript.sleep 20000 > temp.vbs
start /wait temp.vbs
start second.exe
del temp.vbs
This still uses the WSH, but the bat creates the script on the fly.
"Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
news:rCdteGZihghWs...@apple100.NOSPAMfreeserve.co.uk...
Best Regards,
Andrew
Bill Blanton:
start "C:\Program Files\Google\Google Earth Pro\googleearth.exe"
echo wscript.sleep 20000 > temp.vbs
start /wait temp.vbs
start "C:\Documents and Settings\Andrew\Desktop\DUMP\EventManager\EventManager.exe"
del temp.vbs
"Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
news:rfHJNnIGREd1P...@apple100.NOSPAMfreeserve.co.uk...
Thanks for the help.
I have tried what you suggested but nothing happens !!
I run the batch file and 2 little black DOS boxes pop up saying
"C:\Documents and Settings\Andrew\Desktop>"
That's all. Nothing is executed, the 2 DOS boxes just stay there !
Any ideas ??
Best Regards,
Andrew
Blanton:
Much Appreciated !
Andy
Bill Blanton:
> You're right! Sorry, I didn't test it. Forget the bat file, and use
> a visual basic script instead. Copy/paste this in notepad and save
> it as "Andrew.vbs"
>
>
> dim oShell
> Set oShell=WScript.CreateObject("WScript.Shell")
>
> oShell.Run "calc.exe",1,false
> wscript.sleep 20000
> oShell.Run "notepad.exe",1,false
>
>
>
> If it works, replace "calc.exe" and "notepad.exe" with your complete
> programs' paths and names.
>
>
>
>
> "Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
> news:RyulfcsyDK6qn...@apple100.NOSPAMfreeserve.co.uk...
Not sure why, because your theory is correct (as it does indeed work
with your examples).
Think i'll give up !!!
I get error message:
Script : C:\Documents and Settings\Andrew\Desktop\Andrew.vbs
Line : 4
Char : 1
Error : The system cannot find the specified file
Code: 80070002
Source : (null)
Cheers,
Also no line breaks in the line added by the editor.
"Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
news:G2adMwdhWxyDh...@apple100.NOSPAMfreeserve.co.uk...
Cheers,
Andrew
Bill Blanton:
"Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
news:CCtyeSIf0BXGr...@apple100.NOSPAMfreeserve.co.uk...
I have tried that and it does run in the Start - Run command !! - just
not in the vbs file !! - that's the weird bit !!!!
Cheers,
Andrew
Bill Blanton:
Best Regards
Andy
Bill Blanton:
> How about sending me the file as an attachment, so I can look at it.
> Rename it Andrew.txt so it doesn't get flagged and deleted along the
> way.
>
>
>
> "Andy" <andyN...@apple100.NOSPAMfreeserve.co.uk> wrote in message
> news:dtev6UW3Gjzhr...@apple100.NOSPAMfreeserve.co.uk...
>Cheers Bill. Will do, what's the e-mail add to send it to ?
I hope any solutions found are posted to this thread. I'd also like to
start a couple of apps using the vbs script and haven't got it to work
here either, although the calc and notepad example works fine.
--
Zilbandy <zilb...@comcastREMOVETHIS.net> Tucson, Arizona USA
Dead Suburban's Home Page: http://zilbandy.home.comcast.net
PGP Public Key: http://zilbandy.home.comcast.net/pgpkey.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Best Regards,
Andrew
Zilbandy:
Will do. If I figure out what's going on.
I have no problem using the full paths to notepad and calc.
>Will do. If I figure out what's going on.
>
>I have no problem using the full paths to notepad and calc.
Try using a path to some other programs. I've tried using the path to
UltraEdit text editor on my system, and it doesn't work. I get exactly
the same error as Andy is getting. In my case, the path to my program
is "c:\program files\ultraedit\uedit32.exe".
--
Zilbandy
Yep. Spaces in filenames strikes again..
You can either change the path to the short name equivilent, or try
this, where the script will generate the shortpath.
dim oShell, oFSO, oFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell=WScript.CreateObject("WScript.Shell")
Set oFile = oFSO.GetFile("C:\Windows\system32\calc.exe")
oShell.Run oFile.ShortPath,1,false
wscript.sleep 20000
Set oFile = oFSO.GetFile("c:\program files\ultraedit\uedit32.exe")
oShell.Run oFile.ShortPath,1,false
>> Try using a path to some other programs. I've tried using the path to
>> UltraEdit text editor on my system, and it doesn't work. I get exactly
>> the same error as Andy is getting. In my case, the path to my program
>> is "c:\program files\ultraedit\uedit32.exe".
>
>
>Yep. Spaces in filenames strikes again..
>
>You can either change the path to the short name equivilent, or try
>this, where the script will generate the shortpath.
That fixed it here. Thanks for all the help. Andy and I thank you. :)
--
Zilbandy
YW. And thanks for the feedback. I learned something too.
Anyway, this is a "Bat" file and works fine. The only problem I had was
even using many different methods, could not get google earth to run
with with the space in the string, even when I tried to use
start "C:\Google\Google Earth\client\" googleearth.exe or start
"C:\Google\Google Earth\client\googleearth.exe"
This is what I did on my system, apparently google can be cut from it's
location to anywhere you want, there is nothing tied to it, you can
rename the folders or take out the space with no problems. I cut it from
my program (x86) folder and placed it on C:\
This is what worked for me (not using pro but it shouldn't matter).
start C:\Google\GoogleEarth\client\googleearth.exe
echo wscript.sleep 20000 > temp.vbs
start /wait temp.vbs
start C:\Windows\System32\eventvwr.exe
This is a simple workaround that will work fine.
Shorten (take out the spaces) of google as I did and since event manger
won't like being relocated or renamed, simply create a shortcut for it
on your C:\ and name it "a" (extension of a shortcut is .lnk). So if
you follow this example it will look like this:
Code:
--------------------
start C:\Google\GoogleEarth\client\googleearth.exe
ping -n 20 127.0.0.1
C:\a.lnk
--------------------
You could also use the shortcut method on your googleearth.exe rather
than as mentioned above if you wanted, making it even shorter.
Code:
--------------------
start C:\googleearth.lnk
ping -n 20 127.0.0.1
C:\a.lnk
--------------------
I also just tested what someone else wrote for a time delay and it
worked. Using the VB method it would be.
Code:
--------------------
start C:\Google\GoogleEarth\client\googleearth.exe
echo wscript.sleep 20000 > temp.vbs
start /wait temp.vbs
C:\a.lnk
--------------------
Either of the ways work, but I prefer the simpler method. It's less
code and the dos box closes on it's own and no temp.vbs to clean up.
Enjoy!
--
Danbo342
------------------------------------------------------------------------
Danbo342's Profile: http://forums.techarena.in/members/164663.htm
View this thread: http://forums.techarena.in/windows-xp-support/819467.htm
Make sure that line reads
start C:\a.lnk
It will still work, but the dos box will not close.
> Hey Andrew, ...
You thought Andrew was still monitoring this /*over 2-year old*/ thread?
A leech site pretending to have forums by running a webnews-for-dummies
interface that submits improperly formatted posts through a gateway to
Usenet (aka newsgroups).
I see the age of it, but being that I found this topic on a similiar
search, decided to take the time to post my findings should someone else
need assistance.
So in other words, just to help someone, unlike your comment just to
annoy.
| VanguardLH;4731456 Wrote: > Danbo342 wrote:
>> > Hey Andrew, ...
>> You thought Andrew was still monitoring this /*over 2-year old*/ > thread?
>> > http://forums.techarena.in
>> A leech site pretending to have forums by running a > webnews-for-dummies
>> interface that submits improperly formatted posts through a gateway to
>> Usenet (aka newsgroups).
| I see the age of it, but being that I found this topic on a similiar search, decided to
| take the time to post my findings should someone else need assistance.
| So in other words, just to help someone, unlike your comment just to annoy. --
| Danbo342
techarena.in Posts annoy in general. I wish they would f'n get rid of their PITA Usenet
gateway forever. Wer are so tired of seeing replies to Usenet posts eminating from
techarena.in that never quote what they are replying to and ressurecting threads so old
the original posters (OP) no longer care.
The way to access this group is DIRECTLY with any news client via the following news
URL...
news://msnews.microsoft.com/microsoft.public.windowsxp.help_and_support
--
Dave
http://www.claymania.com/removal-trojan-adware.html
Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp
| Who keeps modifying my posts? I take the time to post helpful information, 1st someone
| modifies my last line in the code, taking out "Start" from the "C:\a.lnk" line, and now
| after some idiot posts a comment to my good deed, that message is removed and my reply
| is now added to my original post making it look like I am talking to Andrew... Is this
| the proper use of moderating?
| I believe it's actually quite illegal to change what people say, is it not? So much for
| trying to help a future someone. I'm going to have these screenshots investigated, this
| is bs. -- Danbo342
techarena.in is a POS.
That was in a different block.
As far as Glenn Beck, I never heard of him, you people here are
incredibly rude.
| Wrong!
| Someone deleted a post here and took a reply I had made in a seperate comment block and
| put it into my original post. See end of first comment end
| "I see the age of it, but being that I found this topic on a similiar search, decided
| to take the time to post my findings should someone else need assistance.
| So in other words, just to help someone, unlike your comment just to annoy."
| That was in a different block.
| As far as Glenn Beck, I never heard of him, you people here are incredibly rude. --
| Danbo342
Stop using the piece od sh!t techarena.in forum and do what I told you.
DIRECTLY connect to this news group with any news client via the following news URL...
news://msnews.microsoft.com/microsoft.public.windowsxp.help_and_support
Or is it too much above your intelligence level to it ?
Try these:
news://msnews.microsoft.com
news://msnews.microsoft.com/microsoft.public.windowsxp.help_and_support
Learn how to configure two popular newsreaders:
http://www.frickelsoft.net/news.html
How to configure Microsoft Newsgroups with Outlook Express
http://ilias.ca/moznewsgroups-tb
Subscribing to news.mozilla.org newsgroups with Thunderbird
John
> Who keeps modifying my posts? I take the time to post helpful
> information, 1st someone modifies my last line in the code, taking out
> "Start" from the "C:\a.lnk" line, and now after some idiot posts a
> comment to my good deed, that message is removed and my reply is now
> added to my original post making it look like I am talking to Andrew...
> Is this the proper use of moderating?
> I believe it's actually quite illegal to change what people say, is it
> not? So much for trying to help a future someone. I'm going to have
> these screenshots investigated, this is bs.
And you thought any the participants were still monitoring that /*OVER
2-YEAR OLD*/ thread?
http://forums.techarena.in
A leech site pretending to have forums by running a webnews-for-dummies
interface that submits improperly formatted posts through a gateway to
Usenet (aka newsgroups).
No one here in Usenet has any control over what the moderators or admins do
regarding posts in that forum. Contact them. Better ask them quick as they
may not keep a history of deleting/modified posts so whoever had permission
to do the change would have to recall it from their memory.
You say that you weren't replying to Andrew, and that your post got deleted,
but then your post that does exist start with "Hey Andrew". Uh huh.
Perhaps what you clicked on wasn't Reply or Quote but instead Edit.