Hi All
I have following bat file. I want to open some of the excel files. This task must go under Select a task title by giving echo 6) Sample Reports. when Select 6, then have to display list of Sample reports. Then user is able to give option to open for particular excel file. Path for each excel files are,
C:\Reports\Staff Names.xls
C:\Reports\Codes.xls
C:\Reports\responsible works.xls
C:\Reports\class.xls
It doesn't matter create individual bat files to open for excel file. but these bat file must be called within the following one.
echo off
Reports Menu
:home
cls
echo.
echo Select a task:
echo =============
echo.
echo 0) Report Definitions
echo 1) Run newr001.Bat
echo 2) Run newr002.Bat
echo 3) Run newr003.Bat
echo 4) Run newr004.Bat
echo 5) Exit
set /p web=Type option:
if "%web%"=="0" goto Report Definitions
if "%web%"=="1" Call newr001.Bat
if "%web%"=="2" Call newr002.Bat
if "%web%"=="3" Call newr003.Bat
if "%web%"=="4" Call newr004.Bat
if "%web%"=="5" exit
goto home
:Report Definitions
echo newr001 ............. Report of Staff Names
echo newr002 ............. Report of codes
echo newr003 ............. Report of responsible work
echo newr004 ............. Report of class
Pause
goto home
Thank You
Open Excel file using Bat file
Moderator: DosItHelp
-
- Posts: 44
- Joined: 01 Jan 2011 20:54
Re: Open Excel file using Bat file
i dont know if it works, but usually you can do:
sometimes it helps if add
or
to the beginning
i dont KNOW this, but having two words for the report defs, doesnt really work well with batch. something like "defs" would make a much better term. they wont know what term you are using anyway, since you used "@echo off" at the beginning.
Code: Select all
"(excel.exe)" "(file to open)"
sometimes it helps if add
Code: Select all
start
or
Code: Select all
start ""
to the beginning
i dont KNOW this, but having two words for the report defs, doesnt really work well with batch. something like "defs" would make a much better term. they wont know what term you are using anyway, since you used "@echo off" at the beginning.