Creating a .bat to load selected programs
Moderator: DosItHelp
Creating a .bat to load selected programs
Hi there,
I've got such a simple problem that I can't seem to find any help for it. I hope you guys can assist.
In my job, we use a lot of different programs at once. I want to creat a .bat file to load all these programs in an order.
The programs are simple ones like Outlook and Lotus Notes, and some are word documents and excel spreadsheets. How can I do this?
I appreciate any help you can give me!
I've got such a simple problem that I can't seem to find any help for it. I hope you guys can assist.
In my job, we use a lot of different programs at once. I want to creat a .bat file to load all these programs in an order.
The programs are simple ones like Outlook and Lotus Notes, and some are word documents and excel spreadsheets. How can I do this?
I appreciate any help you can give me!
Re: Creating a .bat to load selected programs
Code: Select all
@echo off
start "" "c:\folder1\program1.exe"
start "" "c:\folder2\program2.exe"
start "" "c:\folder3\file.xls"
start "" "c:\folder4\my book.doc"
Re: Creating a .bat to load selected programs
hi, here is the code:
To add a program u write Call :run and the the program location,
It could be the full location like the red line or if it is recognized by the system like the notepad program you write it's name only
all your program should be written befor the EXIST /B
the green number is the time the batch wait between every program so you let the program to complete it's loading and the computer won't hang
@echo off
cls
Call :run "%programfiles%\Notepad++\notepad++.exe"
Call :run "notepad.exe"
Exit /B
:run
start "" %1
ping localhost -n 2 >nul
goto :eof
To add a program u write Call :run and the the program location,
It could be the full location like the red line or if it is recognized by the system like the notepad program you write it's name only
all your program should be written befor the EXIST /B
the green number is the time the batch wait between every program so you let the program to complete it's loading and the computer won't hang
Re: Creating a .bat to load selected programs
Thanks Abc,
That method works well except when I add in the word document and the excel document.
As an alternative, I also tried
This didn't work either.
Not sure if this matters but both the word and excel docs are on a network drive.
That method works well except when I add in the word document and the excel document.
As an alternative, I also tried
Code: Select all
START "" "N:\docs\etc\word.doc"
This didn't work either.
Not sure if this matters but both the word and excel docs are on a network drive.
Re: Creating a .bat to load selected programs
Hi foxidrive,
I'm so close! I did as you suggested but they didn't open. So, to confirm that the server address was correct, I put in the path to the folders where the documents are kept. Sucess - they opened up. For some reason the document files don't open when I put that information in however.
Any suggestions? Appreciate your help!
EDIT: This is the error I get when I have the file address in the script:
"The process cannot access the file because it is being used by another process"
These docs are used by more then one person at a time, but in word and excel it should stil open and then prompt for read-only right?
I'm so close! I did as you suggested but they didn't open. So, to confirm that the server address was correct, I put in the path to the folders where the documents are kept. Sucess - they opened up. For some reason the document files don't open when I put that information in however.
Any suggestions? Appreciate your help!
EDIT: This is the error I get when I have the file address in the script:
"The process cannot access the file because it is being used by another process"
These docs are used by more then one person at a time, but in word and excel it should stil open and then prompt for read-only right?
Last edited by oxnard on 06 Aug 2012 18:20, edited 1 time in total.
Re: Creating a .bat to load selected programs
If your server is mapped to a drive letter then this *will* work
START "" "N:\docs\etc\word.doc"
Just double check the path/drive and filename.
Also, use the same command but use a drive path and filename on your local machine, to ensure that DOC is a registered filetype. It should open your default .doc viewer with the file loaded.
START "" "N:\docs\etc\word.doc"
Just double check the path/drive and filename.
Also, use the same command but use a drive path and filename on your local machine, to ensure that DOC is a registered filetype. It should open your default .doc viewer with the file loaded.
Re: Creating a .bat to load selected programs
Thanks foxidrive!
Got it to work - realised in my case, my word file and excel file need to set to open as read only, and req a password for read/write.
A huge thanks again!
Got it to work - realised in my case, my word file and excel file need to set to open as read only, and req a password for read/write.
A huge thanks again!
Re: Creating a .bat to load selected programs
You solved it, well done.