Run multiple bat files within bat and passing arguments -


my problem related passing arguments bat files. first argument passed correctly bat second time argument passed it's emtpy.

example:

set comport = com4 call bat1.bat %comport%       ->comport com4 if errorlevel 1 goto end call bat2.bat %comport%       ->comport empty 

so after first call of bat1.bat comport empty. how can make call argument on "main" bat level stay in memory after call of bat1.bat?

@echo off set comport=com4 setlocal&(call bat1.bat %comport%)&endlocal if errorlevel 1 goto end call bat2.bat %comport% :end 

setlocal works on winnt4+, not dos or win9x, if need support have save %comport% other variable before calling bat1.bat , restore value


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -