Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm not finding how you can run a batch file from within a batch file. Can this be done? And if you can could someone please show me the syntax? Thanks!

You can definately do this. All you need to do is put in the name of the batchfile to run. If this is for a login script or something that will run accross the network you must make sure to include the path to the batchfile. You must also be sure that the clients running the script have access to the resource that is hosting the batchfiles. So, if your batch files are test1.bat and test2.bat it would look something like this...
net use \\generic\example
test2 <-------with test2.bat being in the same directory as test1.bat otherwise...net use \\generic\example
c:\scripts\test2.bat
or
\\generic\example\test2.bat
Hope that helps...

Thanks, Viva! I tried it an it worked. I was just a little confused. Is there a way to place a time element on the second batch file you run so it won't execute for a certain length of time after it's initiated?

::-------------------------------------------
::Create a batch file called wait.bat
::add the following line below.
::For batch files that neeed to
::pause for a period of time.
::To use just at the following line
::in your batch file.
:: CALL WAIT 10
::-------------------------------------------@CHOICE /T:N,%1% > NUL
---------------------------------------------
You can use the CALL COMMAND also.
After making the wait.bat file put the following into your other batch file.CALL WAIT 10 (10 is the number of seconds)
CALL \\DOMAIN\Netlogon\test2.bat

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |