Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Help with a simple batch file  (Read 12047 times)

0 Members and 1 Guest are viewing this topic.

Manna420

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 7
    Help with a simple batch file
    « on: August 29, 2013, 03:49:16 AM »
    Hi guys. I am trying to create a simple batch file. Batch file is going to do as follows

    Once i click it, it will start the cmd in a certain location, and after that it should ask to user to execute a command within the same location. Here is what i have figure til now.

    To start the cmd in certain location i have used the following command:

    START cmd.exe /k "cd C:\Program Files\Symantec\Symantec DLO"

    But when i try to get it to execute a command in that same location, for some reason it pops up With another CMD window giving me the error sayint that this command is not recognized, obviously because the .exe file lays in the location i want cmd to start in.

    Here is how my batch file looks like:



    @echo off


    START cmd.exe /k "cd C:\Program Files\Symantec\Symantec DLO"

    pause

    start DLOCommandu -ListMachines -V > C:\list.txt


    Manna420

      Topic Starter


      Newbie

      • Experience: Beginner
      • OS: Windows 7
      Re: Help with a simple batch file
      « Reply #1 on: September 02, 2013, 06:58:32 AM »
      Seriously, nobody can help?

      Salmon Trout

      • Guest
      Re: Help with a simple batch file
      « Reply #2 on: December 15, 2013, 01:45:09 PM »
      Maybe I'm necroposting... I don't think many people look in the Windows Server section, and although you may intend to run the batch on a server OS, the question really is a generic batch one.

      You don't need all those START commands.

      @echo off
      cd /d "C:\Program Files\Symantec\Symantec DLO"
      pause
      DLOCommandu -ListMachines -V > C:\list.txt