PDA

View Full Version : How to launch a .bat file with a parameter (V 7.5)



martyWell
03-19-2005, 10:36 PM
I'm trying to use demoshield 7.5 as a front end to allow a user to copy files to a floppy disk. I first tried setting this up with send to save a file, but I need to let them indicate the floppy drive letter, just in case it isn't drive A. I haven't been able to get tokens to work with the send to action. So, I decided I could just use a batch file to do the actual file copying, but I still need to pass the drive letter to the batch file.

I started with launch associated file.

I can get my batch file to run (I've tried it with the a:\ path hard-coded), so the issue isn't that it isn't finding the file. But, when I use the launch associated file option, it doesn't seem to pass along any parameter. In other words, I can't enter this:

doCopy.bat a:\

for the associated filename (ignore the path stuff for now -- that part's ok)

So, I tried dealing with the launch application, but I don't quite know what to do. This application needs to run on pretty much all versions of windows from 95 on. (That's why I really didn't want to try to deal with specifying the location of the appropriate exe file.)

Has anyone had something like this? I'm probably going to give up trying to pass the parameter to the batch file and just get the batch file to do it, but it's so ugly. In fact, I'm really sad that the sendto action for saving a file won't let me use a token. This is the real problem!

Sorry to ramble on.

Appreciate any help.

Thanks,

Marty

Chandy Navarata
03-21-2005, 06:23 PM
You can launch a batch file using the Launch Associated Application action however there is no mechanism to pass any parameters to the batch file.

Regards,

upfront
03-21-2005, 08:34 PM
I'm not sure if this is a solution for your problem, but if I wanted people to copy files that I supplied to them on their choice of drives; then I would provide a button for them to install an application. Although you are not installing an app, it will provide an interface for copying files! In this way the install menu would just ask them where they wanted to copy the files to....the default A: or the drive of their choice. You will need some type of an install program to construct your install.

Hope this is of some help.

martyWell
03-22-2005, 10:08 AM
upfront,

yes, this is what I've ended up doing. I initially wanted to just use Installshield, but then I didn't want to end up with an entry in the user's registry related to having installed a program. With a little digging and some good luck, I found the code I needed to modify Installshield (this is an older version: 6.3) so it doesn't actually leave any uninstall information and no entry in the registry. So, I have a button that launches the installer exe and waits.

But, I have to say that I'm still disappointed in DemoShield's implementation of their send to action.

thanks for your suggestion,

Marty