i want to call a batch file from another batch file and also want to pass a variable to it. lets say i want to call b.bat from a.bat. my b.bat copies files. so while calling it from a.bat , i want to pass the path of the destination folder to b.bat.
well to b more clear, the destination path will b entered by user, so it will b stored in a variable say ‘x’. how do i pass the path now?
i want to call a batch file from another batch file and also want
Share
As an alternative, you can simply use %TargetPath% in b.bat: environment variables are inherited by subprocesses. But passing a parameter explicitly is probably better from the flexibility and supportability point of view.