Learning Batch file to open a program or a file
>> Friday, 29 June 2012
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
Badrunath Badrunath is offline
Member
Join Date: Jun 2009
Posts: 1,519
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
MahaGuru's Avatar
MahaGuru MahaGuru is offline
Member
Join Date: Nov 2008
Posts: 1,526
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
GeforceUser GeforceUser is offline
Member
Join Date: Mar 2009
Posts: 1,364
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.










0 comments:
Post a Comment