totalcharlotte.blogg.se

Windows 10 batch file not working
Windows 10 batch file not working













windows 10 batch file not working

Remove command call in batch file 1, execute it again and look what you get now. Run batch file 1 and you get the output: This is batch 1 calling now batch 2 and is waiting until it finished. To process another batch file like batch file 2 from within a batch file like batch file 1 and continue processing of batch file 1 after processing of batch file 2 finished, use in batch file 1 the command call for calling batch file 2 like a subroutine.Įcho This is batch 1 calling now batch 2 and is waiting until it finished.Įxample for batch file 2: echo This is batch 2 running XCOPY. So use only xcopy "C:\folder1\itsme.bat" "Y:\" /C /Y /Z in already opened command prompt window and in the batch file. A batch file is interpreted/processed by cmd and therefore it usually does not make sense to use cmd in a batch file. The command cmd does not need to be used usually if a command prompt window is opened already and a command is entered.

windows 10 batch file not working

Execute in a command prompt window cmd /? to get help about this command. The command cmd is for running a new instance of the command line interpreter and need to be used usually only for opening a command prompt window. Second batch file has simple echo commands, so that is why it is working fine. But all the commands in the other batch file clean.bat (which i am calling from the first batch file) are getting executed without any issues. Looks like issue is only with copy command in the second batch file, which will return output. Here, If I double click on Runme.bat, copy.bat is getting executed and copying all the files.īut issue is, it is not copying anything when i try to run the same batch file from windows scheduler. Xcopy "C:\folder1\runrun.bat" "X:\" /C /Y /Z /Q Xcopy "C:\folder1\runrun.bat" "Y:\" /C /Y /Z /Q Xcopy "C:\folder1\runrun.bat" "Z:\" /C /Y /Z /Q Working case: C:\abcd>cmd.exe /C "xcopy "C:\folder1\itsme.bat" "Y:\" /C /Y /Z" Not working case: C:\abcd>cmd.exe /C "xcopy "C:\folder1\itsme.bat" "Y:\" /C /Y /Z" I am trying to execute a command xcopy path1 path2 /Y /C and it is getting executed successfully when i tried from command line and also when i copied it to a batch file and double clicking on that batch file.īut it is not getting executed when i cal this batch file from another fail.















Windows 10 batch file not working