How to call a batch file from within another batch file

Have you tried running an external batch file from within a batch file or script, only to find out that the original batch file script terminated as soon as the external batch script is executed?

Abnormal Batch Termination

Here’s an example.

Let’s say we have a main script called “mainscript.bat” and two external scripts called “external1.bat” and “external2.bat”, with “mainscript.bat” having the following lines:

@echo off
c:testscriptsexternal1.bat
c:testscriptsexternal2.bat

When you try to run the script, you’ll notice that external1.bat will run but external2.bat won’t. This is because external1.bat (the called script) won’t pass the control back to mainscript.bat (the calling script) — which means it won’t get to run external2.bat.

The “CALL” Command

In order to pass the control back to the calling script, you need to use the “CALL” command.

Here’s a simple fix for mainscript.bat:

@echo off
CALL c:testscriptsexternal1.bat
CALL c:testscriptsexternal2.bat

When you run mainscript.bat,  it will call (run) external1.bat. When external1.bat finishes, it will pass the control back to mainscript.bat. Which will then process the next line on the script — in this case, it will call (run) external2.bat — and so on.

DFA Passport Appointment System

The Philippine department of Foreign Affairs (DFA) has implemented a new passport processing system. Philippine passport applications and appointments must now be done online via the official DFA passport application website at http://www.passport.com.ph.

Please note the following:

  • The DFA will not entertain applicants without valid appointments.
  • Please note that if you place multiple appointments, your previous appointments will be automatically canceled.
  • All Saturday Appointments is for rush processing only
  • Applicants with 7:00AM or 7:30AM appointment may go to the DFA for their passport application from 8:00AM onwards on their appointment date.
  • Passport pictures shall also be taken at the DFA premises.

Dick Gordon for President!

Update:

The elections are over and the people have spoken. With Noynoy Aquino as the country’s President-elect, most people are optimistic of the changes that will take place once we’ve transitioned over to the new Aquino-led government.

It’s about time to put aside pre-election choices regardless of who you voted for during last May 10 elections. It’s time to support a new government. It’s time to start over.

Congratulations to Noynoy!

—–

How to change Sun Wireless Broadband DNS settings

For Sun Wireless Broadband subscribers, here are the steps needed for you to create a new Connection Profile and use your preferred DNS server/s.

1. Open the Sun Broadband Wireless application and make sure that it’s disconnected to the internet.

2. On the Sun Broadband Wireless application menu, click “Tools > Options”. The Sun Broadband Options box will appear. Click on “Profile Management” on the left-side menu.

Sun Broadband - Options Menu

3. On the Sun Broadband Options box, click the “New” button. A new profile form will appear.

4. Key in your desired Profile Name (Ex. “Sun – Custom DNS”); Select “Static” APN and key in “fbband” on the APN: field box. Note: For prepaid subscribers, use “minternet” instead.

5. Click on the “Advanced…” button. The Advanced Settings box will appear.

6. Un-select “CHAP” and select “PAP” on the Authentication Protocol Settings; change the DNS Settings to “Static” and key in your desired DNS server IP address/es (The OpenDNS servers IP addresses – 208.67.222.222 and 208.67.220.220 – were used in the example below). Click the “Save” button and click “OK”.

7. The new profile is saved and you can use this to connect to the internet using your specified DNS server/s.

In most cases, especially when using OpenDNS servers, you might notice a slight improvement in internet access speeds and connection stability as compared to using the default Sun Broadband DHCP-issued DNS settings.

—-

Update: 2011-08-30

Just a brief explanation of why you might want to try the above method:

Changing your DNS settings does not guarantee that internet browsing will be faster. This just ensures that you’ll have a stable DNS server to handle all of your domain name resolution requests.

Some ISP’s don’t allot or invest resources for their DNS server infrastructure. So there are instances when the DNS servers used by these ISP’s can’t handle the DNS query load from its internet subscriber base. So when the network is full, and the DNS servers are loaded with requests, there are some instances when a simple request for the IP address of a domain, say www.pjbacolod.com, will turn out empty — hence the intermittent internet connection — because the DNS servers either get overloaded or they simply crash.

Using powerful public DNS servers, such as Google DNS and OpenDNS, which have a very robust global server infrastructure, ensures that you get at least close to a hundred percent DNS service uptime.

Twitter Updates for 2009-11-09

  • Pacman must've damaged De La Hoya's brain more than we thought. The erstwhile "Golden Boy" is at it again. Duh! – http://bit.ly/mQLFr #
  • The Ring website had to take out a portion of De La Hoya's blog re Pacman and Arum because of his false allegations. http://bit.ly/1MYdyH #
  • "I could’ve stood there and put my face in front of him and he couldn’t have hurt me." – DLH on Pacquaio – So why quit? http://bit.ly/2k4czc #

Powered by Twitter Tools