bat or vbs re posted
Moderator: DosItHelp
-
- Posts: 6
- Joined: 17 Mar 2016 09:56
bat or vbs re posted
Hello
I am very new at this so please be patient with me ..I have a programme that runs on my 32bit XP SP3 Machine, it works very well but has two error messages when launching. The error messages are to do with a non certified GPU but my programme works fine with the GPU so that bit is OK, to launch the programme I have to hit the enter key twice getting past both error messages.
What I really would like to do and I have spent some 6 hours trying to write a bat file or vbs that is a single hit clearly I have no idea how to do this - I would always spend time researching problems but I am stuck with this and wondered if I could get some help.
I have written a bat file contents below that actually launches my prog but then it stops at the first error message waiting for me to hit the enter key.
" cd C:\Program Files\my prog.exe
start /? [enter][enter]
The (my prog.exe) is obviously not the real programme.
Could somebody kindly help me ?? it may well be that what I have below is completely wrong in that case I am more than happy to try something else - I am also not clear if I need a bat or vbs file but what I do know is that I need some help.
Thanks
Ps ( last post not published ) for some reason must have been a publishing glitch/error on my part maybe ?
I am very new at this so please be patient with me ..I have a programme that runs on my 32bit XP SP3 Machine, it works very well but has two error messages when launching. The error messages are to do with a non certified GPU but my programme works fine with the GPU so that bit is OK, to launch the programme I have to hit the enter key twice getting past both error messages.
What I really would like to do and I have spent some 6 hours trying to write a bat file or vbs that is a single hit clearly I have no idea how to do this - I would always spend time researching problems but I am stuck with this and wondered if I could get some help.
I have written a bat file contents below that actually launches my prog but then it stops at the first error message waiting for me to hit the enter key.
" cd C:\Program Files\my prog.exe
start /? [enter][enter]
The (my prog.exe) is obviously not the real programme.
Could somebody kindly help me ?? it may well be that what I have below is completely wrong in that case I am more than happy to try something else - I am also not clear if I need a bat or vbs file but what I do know is that I need some help.
Thanks
Ps ( last post not published ) for some reason must have been a publishing glitch/error on my part maybe ?
Re: bat or vbs re posted
You may use a Batch-JScript-Hybrid Script. Try
Save the script with file extension .bat
You can play around with the delays. Depending on the speed of your computer 1000 milliseconds may or may not be enough time to load the window. Note that the SendKeys method will always be applied to the window that currently has the keyboard focus.
It's not your fault but is a forum policy that the first posts of a new member have to be approved before they are published. We had some bad experiences in the past ...
Regards
aGerman
Code: Select all
@if (@a)==(@b) @end /*
@echo off &setlocal
start "" "C:\Program Files\my prog.exe"
cscript //nologo //e:jscript "%~fs0"
exit /b
*/
var oShell = new ActiveXObject('WScript.Shell');
WScript.Sleep(1000);
oShell.SendKeys('~');
WScript.Sleep(1000);
oShell.SendKeys('~');
Save the script with file extension .bat
You can play around with the delays. Depending on the speed of your computer 1000 milliseconds may or may not be enough time to load the window. Note that the SendKeys method will always be applied to the window that currently has the keyboard focus.
Ps ( last post not published ) for some reason must have been a publishing glitch/error on my part maybe ?
It's not your fault but is a forum policy that the first posts of a new member have to be approved before they are published. We had some bad experiences in the past ...
Regards
aGerman
-
- Posts: 6
- Joined: 17 Mar 2016 09:56
Re: bat or vbs re posted
Hello aGerman
I tried it crossing my fingers .. but it stopped at the same place in the launch sequence, I then did the usual and hit the enter key twice which completed the loading process.
The 1000ms seemed OK but just to satisfy myself I extended both to 1500ms but it made no difference
Any other suggestions would be much appreciated
Ps No explanation needed for the delayed posting - I fully understand
I tried it crossing my fingers .. but it stopped at the same place in the launch sequence, I then did the usual and hit the enter key twice which completed the loading process.
The 1000ms seemed OK but just to satisfy myself I extended both to 1500ms but it made no difference
Any other suggestions would be much appreciated
Ps No explanation needed for the delayed posting - I fully understand
Re: bat or vbs re posted
What kind of program are we talking about? Is it a game? In this case you might have no chance. Most of them are protected against click-bots. Hence SendKeys won't work.
-
- Posts: 6
- Joined: 17 Mar 2016 09:56
Re: bat or vbs re posted
it is a non liner editing programme called Avid Media Composer .. its not a new version at all I have had it for years and it works perfectly so I have never upgraded it .. the only issue I have is that the GPU is not certified which is why I get the error messages when launching but the GPU works perfectly I can use all the effects etc
I just have this nagging issue with the launching - if I am away from the machine or take a call it just sits waiting for me to enter x 2 very annoying.
I just have this nagging issue with the launching - if I am away from the machine or take a call it just sits waiting for me to enter x 2 very annoying.
-
- Posts: 6
- Joined: 17 Mar 2016 09:56
Re: bat or vbs re posted
Not sure if this helps but there is a 38 second delay ( while the programme loads ) before the 1st error message comes up when I hit enter the 2nd time the 2nd error message comes up immediately
This may be a silly question but can an equivalent delay be written into the bat file ??
This may be a silly question but can an equivalent delay be written into the bat file ??
Re: bat or vbs re posted
Not sure if this helps but there is a 38 second delay ( while the programme loads ) before the 1st error message comes up when I hit enter the 2nd time the 2nd error message comes up immediately
The first Sleep function specifies the delay between starting the program and sending the first Enter. Just try to increase it to - say - 40000 ms.
-
- Posts: 6
- Joined: 17 Mar 2016 09:56
Re: bat or vbs re posted
Getting somewhere now
The first error message came up at the 38 second mark but when I hit enter the 2nd error message flashed and the programme launched .... so something good is happening.
it needs a bit more tweaking I think
The first error message came up at the 38 second mark but when I hit enter the 2nd error message flashed and the programme launched .... so something good is happening.
it needs a bit more tweaking I think
Re: bat or vbs re posted
Did you wait the full 40s before you hit Enter?
Did the window have the Keyboard Focus before you hit Enter? If not, please tell me exactly what window title shows up in the task bar when the error message occurs.
Did the window have the Keyboard Focus before you hit Enter? If not, please tell me exactly what window title shows up in the task bar when the error message occurs.
-
- Posts: 6
- Joined: 17 Mar 2016 09:56
Re: bat or vbs re posted
Launched it 5 times now .. and it works perfectly
Thank you so much for this, I can not tell you how much of a pain this was but now its all fixed
All the best from the UK
Thank you so much for this, I can not tell you how much of a pain this was but now its all fixed
All the best from the UK
Re: bat or vbs re posted
You're wellcome