DOS 'start' command

  dalek111 18:21 18 Jan 09
Locked

hi

i am trying to run an installer through a batch file. when the installer runs, i want the batch file to send keystrokes to the installer, but when the installer runs, the batch file waits for completion before continuing even though i have not put the /wait command in the string. any help would be appreciated

  MAJ 18:48 18 Jan 09

How, what command are you using to pass the keystroke? Which keystroke? Which version of Windows?

  dalek111 19:15 18 Jan 09

sorry, i should have been more clear. it does the same on vista and xp and im using a really good program called 'DoKeys'. click here my main problem is just getting the DoKeys commands to run while the installer is running. i know i could call a second batch file to run the installer, but it seems a 'nasty' way od doing it and the second dos box can take the focus from the installer, (so the keystrokes dont work). thanks for your reply,

  woodchip 19:16 18 Jan 09

You do know there is no DOS in XP or VISTA

  dalek111 19:18 18 Jan 09

its command prompt...... batch files?

  Switcher 20:04 18 Jan 09

Whilst MS-dos is in theory not installed on XP there is a very good simulation of it with a stripped down command set. The old MSdos prompt is replaced or renamed as the Command prompt and it is very easy to run batch files in this mode.
DALEK can you post a copy of the batch file.

  dalek111 21:07 18 Jan 09

this is the batch file:


title Uninstalling FWH
echo off
cls

taskkill /im fwh.exe /f
cls


echo.
echo stage 1
echo please wait...

DoKeys /WS 1000 ""
"C:\Program Files\Fast Windows Hider\uninst.exe"
cls


echo.
echo stage 1
echo please wait...
DoKeys /WS 800 "y"
DoKeys /WS 1000 "{enter}"

start cmd

DoKeys /WS 800 "C:\FWH\data"
DoKeys /WS 200 "{enter}"

DoKeys /WS 800 "{enter}"

DoKeys /WS 800 "{tab}"
DoKeys /WS 100 " "

DoKeys /WS 800 "{enter}"

DoKeys /WS 800 "{enter}"

DoKeys /WS 3800 "{enter}"

DoKeys /WS 800 "{tab}"

DoKeys /WS 800 "{F9}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 " "

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{tab}"

DoKeys /WS 5 "{enter}"

del "C:\Users\Will 2\Desktop\Fast Windows Hider.lnk"

taskkill /im fwh.exe

exit




taskkill is an addon to close the program you are reinstalling (it keeps crashing by the way, thats why i need to keep installing it). this version calls another batch file to open the installer, which gets round the problem, its just not very neat. (the:

start cmd

DoKeys /WS 800 "C:\FWH\data"
DoKeys /WS 200 "{enter}"

bit). this opens a new dos prompt and enters the location of the batch file so it loads it in a new box. this allows the first to keep running. it is working, but i would like to keep everything in one box.

  Switcher 20:21 19 Jan 09

I've had a look at your batch file. I don't know if my suggestions are relevant but here goes. It appears that te first thing you do is run Taskkill, then after a delay of 1 second run the uninstall program for FWH sending a Y after 0.8 sec then an "enter" 1 sec later. Then you open a new prompt, change to a new directory within that box and start sending keystrokes. Where do those keystrokes go -- To the new box or to the installer. If to the installer then you finish off by deleting the shortcut to the program FWH then killing the program again. Meanwhile what is happening in the first box. I think that your problem might be that although you can run a batch file at the same time as a GUI program you can't run two batch files at the same time as the lines are read seqentially from the disk not from memory so one batch file stops whilst the other is running. Perhaps you could use one batch file to start the installer and start another batch file within the first one WITHOUT using call that would stop the first batch file whilst leaving the installer running.

  dalek111 20:34 19 Jan 09

Thanks switcher, you got that all pretty right. The second batch file calls the installer and then all the other keystrokes are sent to the installer. The second batch file only contains.....

title Reinstalling FWH
echo off
cls

echo.
echo stage 2
echo please wait...

"C:\FWH\RUN SECOND.exe"
exit

and because the first batch file does not run the batch file, but opens a new cmd window, and then sends...

DoKeys /WS 800 "C:\FWH\data"
DoKeys /WS 200 "{enter}"

to get the second cmd window so that it runs the batch file. Because the first batch does not actually call the second directly, both run independently. After the second file runs the installer, it just remains open in the background while the first batch send the required keys to the installer to select the appropriate settings.

Oh, by the way, the first 'Taskkill' has a '/f' in the string, the fwh (the app I'm reinstalling) os forced to close. The second time, because the '/f' is not there, the app window is closed, but it keeps running from the task-box. (The shortcut is not needed as the app runs automatically with windows)

  Switcher 21:00 19 Jan 09

Thanks DALEK, I did notice the switches in taskfill and understand now. Sorry I can't help you it is some years since I played around with batch files much, except to do little things like replace the exit comand with x or use one to ping from each PC in my network in turn. Incidentally like you I tried to register to download the dokeys.zip but was unable to do so.

  dalek111 21:03 19 Jan 09

switcher: dokeys is freeware, so if you want, i can email it to you

This thread is now locked and can not be replied to.

Hands-on: Samsung Galaxy S8 review

1995-2015: How technology has changed the world in 20 years

Samsung's beautifully designed Galaxy S8 makes for better VR experiences too

47 iPhone camera tips to help you take better photos