Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Learning Batch file to open a program or a file

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 04-04-2011
Member
 
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.

Reply With Quote
  #2  
Old 04-04-2011
Member
 
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
Reply With Quote
  #3  
Old 04-04-2011
Member
 
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.
Reply With Quote
  #4  
Old 04-04-2011
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Learning Batch file to open a program or a file"
Thread Thread Starter Forum Replies Last Post
Windows batch file: set output of program to a variable? supernoob Windows Software 5 17-10-2010 05:58 AM
batch file to open 2 progs with time delay kyosang Windows XP Support 4 19-12-2009 09:36 AM
What program should I use to open a DLL file? Enriquee Operating Systems 3 28-11-2009 04:07 AM
Is it possible to right click on cmd batch file and try to open it in a directory Kamran Operating Systems 2 26-05-2009 10:41 AM
How to open HTML file in VB.net program? REEMAD Software Development 4 19-02-2009 11:24 PM


All times are GMT +5.5. The time now is 06:13 AM.