1

I have a batch file which calls .xlsm, access and sqlcmd.

I scheduled the batch file in task scheduler for every day.

  • When we used Windows 7 on computer, it worked perfectly.
  • After upgrading to Windows 10, most of the cases it stops running after opening .xlsm.
    • The command prompt windows is opened, but nothing happens.

The mistake is not with the macro, because on other computer (with Windows 7) it runs perfectly.

First I've tried this code in my batch file:

"\\xy\Foldername\KillExcel.bat"

"\\xy\Foldername\SpoolfileConvert.xlsm"

sqlcmd -S servername -d SCM -i "\\xy\Foldername\DeleteTable.sql" -o    "\\xy\Foldername\DeleteTable.txt"

"\\xy\Foldername\UploadData.accdb"

sqlcmd -S servername -d SCM -i "\\xy\Foldername\Data_cleaning.sql" -o "\\xy\Foldername\Data_cleaning.txt"

Thanks for the information, i tried the following code.

I deleted all the not neccessary call commands from my code. Keeped the first one, because it calls another batch.

call "\\xy\Foldername\KillExcel.bat"

start "Excel" /wait /min Excel.exe "\\xy\Foldername\SpoolfileConvert.xlsm"

sqlcmd -S servername -d SCM -i "\\xy\Foldername\DeleteTable.sql" -o    "\\xy\Foldername\DeleteTable.txt"


start "Access" /wait /min MSACCESS.exe "\\xy\Foldername\UploadData.accdb"

sqlcmd -S servername -d SCM -i "\\xy\Foldername\Data_cleaning.sql" -o "\\xy\Foldername\Data_cleaning.txt"

The Excel and Access closes themselves automatically. But the sqlcmd should not run before the Excel and Access finish their process.

Hajnalka
  • 11
  • 3
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/217936/discussion-on-question-by-hajnalka-why-my-batch-file-stops-working-on-windows-10). – Samuel Liew Jul 16 '20 at 05:58

0 Answers0