Results 1 to 4 of 4

Thread: Learning Batch file to open a program or a file

  1. #1
    Join Date
    Mar 2011
    Posts
    47

    Learning Batch file to open a program or a file

    I had been running my system on Windows XP Pro SP2 for which I had installed AVG Free 9.0 for having network security. Also I had installed MS Office home and student 2007 on my desktop system. Once I was learning about batch files which I started from scratch. I came to know that I was able to get a .bat file to get a command prompt with some commands. But, when I tried to get Word document I got the error message saying “Windows cannot find c:\document”. But when I tried to search it through I was able to see the file in the folder. I had given the entire path of the file in search utility and it found out quickly. But when I try to copy and paste the path of the file into the batch file it gives me error. Any suggestions like how this problem is resolved.

  2. #2
    Join Date
    Jun 2009
    Posts
    1,518

    Re: Learning Batch file to open a program or a file

    In my case I was able to run a simple file which I made in .txt format or say in notepad. By avoiding entire path confusion I simply loaded my file named ‘test.text’ into the C drive. Hence the entire path name would be like this c:\test.text. Now to run my file I need to follow the instructions given below:
    1. Click on start
    2. Go to all programs
    3. Go to accessories
    4. Select command prompt
    5. Type start c:
    6. Press enter
    7. Type test.text

  3. #3
    Join Date
    Nov 2008
    Posts
    1,514

    Re: Learning Batch file to open a program or a file

    To open the file from any given path where it is being stored follow the instruction given below:
    1. Click on start
    2. Go to run
    3. Type cmd
    4. It will open the command prompt
    5. Type %SystemRoot%\explorer.exe “path”
    6. Press enter
    7. It will now open your file
    Over here you need to give your file location in “ ” codes. It will search into that location and will open the file from the location mentioned in it.

  4. #4
    Join Date
    Mar 2009
    Posts
    1,360

    Re: Learning Batch file to open a program or a file

    For opening multiple applications you can use batch command file to open the folder or file. For this follow the instructions given below:
    Code:
    Start /d c:\Windows\System32\Spider.exe
    Start /d c:\Program Files\Movie Maker”movimk.exe
    The above commands are used to open the application Spider game and movie maker. Over here start denotes a separate window for each program. “/d” denotes the path of the program.

Similar Threads

  1. Windows batch file: set output of program to a variable?
    By supernoob in forum Windows Software
    Replies: 5
    Last Post: 17-10-2010, 05:58 AM
  2. batch file to open 2 progs with time delay
    By kyosang in forum Windows XP Support
    Replies: 4
    Last Post: 19-12-2009, 09:36 AM
  3. What program should I use to open a DLL file?
    By Enriquee in forum Operating Systems
    Replies: 3
    Last Post: 28-11-2009, 04:07 AM
  4. Replies: 2
    Last Post: 26-05-2009, 10:41 AM
  5. How to open HTML file in VB.net program?
    By REEMAD in forum Software Development
    Replies: 4
    Last Post: 19-02-2009, 11:24 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,690,830.03479 seconds with 17 queries