Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: .bat file commands not executing all the sudden. No error messages.

10 Feb 2018   #1
JimmySteve

Windows 7 Professional
 
 
.bat file commands not executing all the sudden. No error messages.

For over a year I had been using Windows Task Manager to open a
Code:
.bat
file on a schedule everyday. This has worked both in Windows 7 Pro & Windows 10 Pro when I updated. I have recently restored my PC back to Windows 7 Pro with nothing added to it but a couple RDPs, Microsoft Office & some network drives.

Please keep in mind, I know very little about
Code:
.bat
and
Code:
cmd
coding.

This
Code:
.bat
file was extremely simple. It called 8 different
Code:
.xlsm
Excel files that had auto macros loaded in them. It worked perfectly for over a year using the following commands in the
Code:
.bat
file to open the
Code:
.xlsm
files ...

Code:
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet1.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet2.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet3.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet4.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet5.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet6.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet7.xlsm
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHSet8.xlsm
The commands were working in such a fashion ...

1. First
Code:
.xlsm
file would open
2. Auto macros would run
3. Excel application would close via VBA script in the auto macros
4. Repeat until no more commands &
Code:
cmd
would close along with Excel @ end of last command

I recently edited some of the VBA code in a couple of these
Code:
.xlsm
files. I should also note that I accessed my PC using RDP around the same time (which I don't normally do), that I have administrative privileges and UAC is turned off.

My Issue

All of the sudden the
Code:
.bat
file will get stuck and not execute one of any of the commands (it's random). It will go smoothly through opening let's say 5 files and when it's time to open the 6th, it will simply not show the code in the
Code:
cmd
. It just sits there on the 5th command (which has already been completed ...

The issue is not with Excel or Task Scheduler. It is with the code not executing in the cmd. It just stops at random and does not execute the next command to open the next file.

I have tried the following variations of code to open these files but I am continuing to get the same issue ...

Code:
@Echo
C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram
IorpiaSCHSet1.xlsm
Code:
"C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHProgramSet1.xlsm"
Code:
Start /Wait cmd /k "C:\Users\JimmySteve\Documents\Macros\IorpiaSCHProgram\IorpiaSCHProgramSet1.xlsm && exit"
There are others that I am not recalling and nothing seems to make a difference.

To make things even more frustrating ... I have witnessed the
Code:
.bat
file completing successfully when scheduling a couple minutes away from my editing. It also does not seem to matter if I run manually.


My System SpecsSystem Spec
.
16 Feb 2018   #2
Snick

Win 10 x64, Linux Lite, Win 7 x64, BlackArch, Kali, VMWare Workstation Player, OpenVPN
 
 

Hi JimmySteve,

Did you create the batch file?

Do you know how to edit it? right-click file, choose edit, to open it in Notepad and view contents.

Have you tried replacing the .bat file with another with the same commands. Sometimes an executable, which a batch file is, gets corrupted. Either it won't run at all or partially runs and then hangs because of either a dropped bit or a flipped bit.

I wouldn't try to copy and paste the text into another open Notepad file as you most likely will copy the error causing text to the new file. I'd retype the first line and then copy paste it for the additional lines, then chang the numbers at the end of "Set" to match your original.

You can create a batch file in Notepad. When you save it, you have to change the save as type to all then add the .bat to the end of the filename. Notepad default it .txt, a text file.

Have you tried replacing the .bat file with another with the same commands. Sometimes an executable, which a batch file is, gets corrupted. Either it won't run at all or partially runs and then hangs because of either a dropped bit or a flipped bit.
My System SpecsSystem Spec
Reply

 .bat file commands not executing all the sudden. No error messages.




Thread Tools




Similar help and support threads
Thread Forum
error messages with windows defender, hosts file & microsoft essential
Hi, I can't open my hosts file. i want to block websites. when i right click on the hosts file to run as administrator i get . I cant open windows defender. When i click on it i get error message i can't install microsoft essentials. this just happened recently when i had a virus or malware...
System Security
ntdll.dll driver error with executing applications
Hello... Can anybody please help me with the drivers problems im facing with. Sorry about my english and Im also not a computer expert but Ill tryy to explain a problem anyway. Im working on a Toshiba Portege R830 laptoo with Win7 64 installed. 2 Days ago im started to reciving error msg...
Drivers
Including some commands in an unatttend file
Hi Running the sysprep /generalize /oobe /reboot /unattend:c:\Unattend.xml command in Audit mode, how do I create an answer file that allows to: 1) include a partition in the system protection of Windows 7 SP1. 2) rename and put a password to the Administrator account. 3)...
Installation & Setup
Windows 7 Answer File Error Messages
When I try to save my Answer File that I've created for my Windows 7 PC I press on Tools and then on Validate Answer File, it give me in the sector Validation a lot of errors. In my book (MCTS 70 - 680), they say that I need to change my settings. Now is my question: How and which settings do I...
Performance & Maintenance
Need help wih a .bat file commands
Im not sure if this is a grate place to ask this.. but... well Windows does speak DOS commands... well sorta :D anyway, im trying to set up a batch file that would first transfer all the files and subfolders from "a" folder to "b" folder, and then would delete all the subfolders and files in "a"...
Software


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:04.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App