PDA

View Full Version : Run BAT then Windows Application



kyham
07-09-2000, 07:12 PM
What I need to do is run a BAT file to delete all *.CDX files in a specific folder, then start up a Windows application. Would like to be able to do this both at startup and a desktop icon. Don't seem to find a way to do this or just doing it wrong.

Can anyone help?

Thanks

Don

Home of "JEANNIE, The Home That Listens"
A voice controlled automated home as seen on HGTV's Dream Builders show # 506.

Featuring HAL2000 from Home Automated Living
(automatedliving.com)

Nick
07-09-2000, 08:07 PM
In a text editor type:-


del C:\path_to_folder\*.cdx
C:\path_to_exe\myprog.exe


Save as myname.bat and create a shortcut, add to the startup group and to desktop. The options to shut the dos box after running can be found in the 'properties' of the shortcut to a *.bat file, or if you do a search in here, *somewhere* is a solution by jstolz for shutting after script has run.

Nick

POBrien
07-10-2000, 07:24 AM
You can also place Nick's "del" example in the autoexec.bat file. This file executes before windows starts loading. add @echo off to the top line so the command will not be displayed upon boot.

@echo off
del "C:\path to folder\*.cdx"

(if the folder name is more that 8 characters or contains spaces you'll need " quotations marks" at the beginning and ending of the entire path or you can use the 8.3 dos format for the folder name).

kyham
07-11-2000, 04:52 AM
Windows is already running. The application shuts down, then starts up again. Before it restarts, I need to delete all the *.cdx files so that the application rebuilds the indexes for the database. Windows does not shut down while this is happening.

I have tried making a BAT file and have a desktop shortcut point to it. The BAT file does the delete but I have been unable to get the windows APPLICATION, not windows itself, to restart.



Home of "JEANNIE, The Home That Listens"
A voice controlled automated home as seen on HGTV's Dream Builders show # 506.

Featuring HAL2000 from Home Automated Living
(automatedliving.com)

Nick
07-11-2000, 03:10 PM
Need more info... what app are you trying to start? You say it 'shuts down then starts up again'? Is this automatically?

Nick

kyham
07-12-2000, 05:01 AM
I have a home automation system that I recycle once a week. I bring it down, then need to bring it right back up again. During the down time, I need to delete all the .CDX files so that when the system comes back up again, they will get rebuilt. Under some circumstances, these CDX files get corrupted.

The program is HAL2000 and I currently manually bring it down, switch to MS-DOS, run the batch file, then bring HAL2000 back up again. I want to automate this so I don't have all the hassle.



Home of "JEANNIE, The Home That Listens"
A voice controlled automated home as seen on HGTV's Dream Builders show # 506.

Featuring HAL2000 from Home Automated Living
(automatedliving.com)

fenterbug
07-12-2000, 04:21 PM
Are you getting any error messages when the BAT file tries to start HAL2000? What does happen? Do you have a shortcut to HAL2000 anywhere? If so, you can run that from your BAT file instead of the actual executable. That way you get all the parameters in the shortcut. Also, you are dealing with a DOS batch file. Is your path in 8.3 format? Spaces will screw you up, but you can put quotes around it no prob.

kyham
07-14-2000, 10:46 PM
The program just does not start up. The EXE is not in 8.3 format but put the name in quotes but still nothing. The delete for the CDX files work fine but the next step in the BAT file is just the program EXE name in quotes. No messages and no execution. Will try renaming the EXE to be in 8.3 format to see if that makes any difference.

Home of "JEANNIE, The Home That Listens"
A voice controlled automated home as seen on HGTV's Dream Builders show # 506.

Featuring HAL2000 from Home Automated Living
(automatedliving.com)

jstolz
07-15-2000, 02:35 AM
This is getting confusing--can you just cut/paste your bat file in here so we can see it? There are so many possibilities for why the app won't start (or seem to start).

Regards...

Rocker6
07-15-2000, 02:28 PM
OK I think I got it...

instead of putting your batch file by itself on the line, put the word start before it.

start is a windows program that you have to use to lunch anything from a batch file (or so I've heard)...

let me know what you think.

---
Joseph Volence
MCP & A+ certified
rocker6@earthlink.net

kyham
07-16-2000, 01:56 PM
Here is the bat file I am trying to run.


cd \progra~1\hal200~1\data
del *.cdx
cd ..
'hal2000 system server.exe'


Home of "JEANNIE, The Home That Listens"
A voice controlled automated home as seen on HGTV's Dream Builders show # 506.

Featuring HAL2000 from Home Automated Living
(automatedliving.com)

jstolz
07-16-2000, 07:16 PM
Try this:

@echo off
cd \progra~1\hal200~1\data
del *.cdx
cd ..
start "hal2000 system server.exe"

Regards...