Page 1 of 2 12 LastLast
Results 1 to 5 of 10

Thread: Batch File on XP doesn't work!

  1. #1
    bbelagodu Guest

    Batch File on XP doesn't work!

    I'm trying to launch a batch file to run on Windows XP but it doesn't work,

    LaunchAppAndWait("install.bat","", WAIT);

    This doesn't launch the batch file. I'm able to open up the install.bat using OpenFile command and display the command in a dialog.

    I've read in previous threads about batch files working on 2000, NT but not on XP. Is this correct, can somebody provide me some answers?

    Thanks

  2. #2
    Join Date
    May 2003
    Location
    Birmingham, West Midlands, England
    Posts
    673
    I'm not sure, but you may have to run CMD.EXE, the command processor, and pass it "install.bat" as its command parameter.

    You may also have to set the current directory to where install.bat is located.

    You will have to watch out for DS9 changing the default directory in LaunchAppAndWait unless you use the option LAAW_OPTION_NO_CHANGEDIRECTORY.

    Hope that helps,

    David
    Installer Engineer
    David Briggs Software Services

  3. #3
    bbelagodu Guest

    Still no solution!

    Thanks for the reply.

    The directory settings is appropriate. I launch cmd.exe and try to launch 'install.bat' file but it doesn't work!

    If I copy the same file to a temp folder and execute it, then it works great.

    Ex:
    I'm trying to install a tool into c:\Program Files\MyTool and 'install.bat' file is present in MyTool directory.

    so from install shield, using LanchAppAndWait, I launch cmd.exe and pass 'install.bat' as the argument. The directory in cmd.exe is set to 'MyTool' and 'dir' command lists my install.bat, when I run to explicitly run install.bat from this directory, it doen't work. While still debugging I created a 'test.bat' and entered some echo commands, this doesn't work either. I copied over the test.bat file to c:\temp and executed the file, it works great.

    So, when I'm trying to install the tool, the directory in which these batch files are present doesn't seem to execute!!

    Any further clues?

    Thanks

  4. #4
    Join Date
    Oct 2001
    Posts
    201
    have you tried to ChangeDirectory to the directory the batch file is located in? I've found that to solve some of my LaunchApp issues.

    good luck.

    d

  5. #5
    bbelagodu Guest

    No solution yet!

    Yes. I change directory to the file in which it is located. I even am able to open the file by using OpenFile command and read the contents of the file and display it.

    Even launch cmd.exe takes me to the desired directory and I'm able to issue 'dir' command and look into the file. In the same directory if I issue 'install.bat' command, it fails. Copying it to a different directory and calling 'install.bat' suceeds!

    This is happening during the product install, so the directory in which I'm trying to launch 'install.bat' is probably still commanded by Installshield!

    Not sure what the problem is?

    Any help, greatly appreciated.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •