- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: How to call another batch from one batch file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2008 10:16 PM
тАО10-15-2008 10:16 PM
Help me with this....plss
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2008 10:21 PM
тАО10-15-2008 10:21 PM
Re: How to call another batch from one batch file
@echo off
call 2.bat
C:\>type 2.bat
@echo off
echo hello
Run 1.bat and the result will be:
C:\>1.bat
hello
1.bat called 2.bat
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2008 10:37 PM
тАО10-15-2008 10:37 PM
Re: How to call another batch from one batch file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2008 11:22 PM
тАО10-15-2008 11:22 PM
Re: How to call another batch from one batch file
D:\f1.bat
In
f1.bat - u have
echo Hi dude u r in f1 file
@pause
f2
@pause
f3
@pause
echo all the files are executed
@pause
in D:\f2.bat
In f2.bat - u have
echo Hi dude u r in f2 file
Inf f3.bat - u have
echo Hi dude u r in f3 file
In the above case i wanna call using the same f1.bat file to exec both f1 and f2 but how wil i do this...?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 03:42 AM
тАО10-16-2008 03:42 AM
Re: How to call another batch from one batch file
though your question is faaaar from HP-UX:
In a .bat file the variable
%0%
contains the filename used at execution time.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 03:59 AM
тАО10-16-2008 03:59 AM
Solutionf1.bat - u have
echo Hi dude u r in f1 file
@pause
call f2.bat
@pause
call f3.bat
@pause
echo all the files are executed
@pause
-------------
Note the call statements i put in front of f1 and f2. And added their extensions as part of normal coding technique
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 04:04 AM
тАО10-16-2008 04:04 AM
Re: How to call another batch from one batch file
C:\>type f1.bat
@echo off
echo Hi dude u r in f1 file
@pause
call f2.bat
@pause
call f3.bat
@pause
echo all the files are executed
@pause
C:\>type f2.bat
@echo off
echo Hi dude u r in f2 file
C:\>type f3.bat
@echo off
echo Hi dude u r in f3 file
Now to execute f1.bat and see the result:
==========================================
C:\>f1.bat
Hi dude u r in f1 file
Press any key to continue . . .
Hi dude u r in f2 file
Press any key to continue . . .
Hi dude u r in f3 file
Press any key to continue . . .
all the files are executed
Press any key to continue . . .
NOTE:
Put the @echo off at the beginning of each .bat file.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 04:13 AM
тАО10-16-2008 04:13 AM
Re: How to call another batch from one batch file
I'm getting in the habit of not answering questions for those who don't post points. As there are people out there who've asked hundreds of questions and don't assign points.
You're not one of them. I see you're brand new to the forums and haven't assigned any points yet.
It's good etiquette to say thank you with points. Patrick Wallek put up some suggested etiquette guidlines for all of us.
Here's the link
http://66.34.90.71/ITRCForumsEtiquette/
Also...Welcome to the ITRC forum. Hope you enjoy it.
Regards
Also here's a linke to the HP support forums - overview and FAQs
http://forums11.itrc.hp.com/service/forums/helptips.do?
Which contains:
How many points should I assign to replies?
Every response to your question is eligible to earn between 1-10 points. No need to worry about running out of points - when a truly awesome reply rolls in that deserves a 10, you will be able to assign it a 10! However, be careful to assign points based on the value that a reply truly provides. Use the following scale as a guideline:
o N/A: The answer was simply a point of clarification to my original question
o 1-3: The answer didn't really help answer my question, but thanks for your assistance!
o 4- 7: The answer helped with a portion of my question, but I still need some additional help!
o 8-10: The answer has solved my problem completely! Now I'm a happy camper!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2008 09:25 PM
тАО10-16-2008 09:25 PM