also @ TechSpot: Windows logo to get a Metro makeover in Windows 8
Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Sign up or Login to participate.

Go Back   TechSpot OpenBoards > Software > Software Apps

Download Now:

Programs won't execute in batch files

Page 1 of 2 1 2
Thread Tools Search this Thread
  #1  
Old 11-23-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
Programs won't execute in batch files

Basically, if the command is part of the shell such as "echo" the batch file won't have a problem with it. But if you try to execute ANYTHING that isn't part of the shell such as chkdsk for example which is a program... you get nothing.

What's really weird is if you launch cmd manually and type something in it works perfectly. I'm guessing this is some kind of permissions issue but I am using an admin account. Anyone seen this before?
  #2  
Old 11-23-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
You can use the DOS "Start" command (in your batch file), ie:

Start chkdsk C: /r

To start CheckDisk (actually, it will ask you Yes or No, to start on next restart)

Edit:

Oh or "Call"

Call chkdsk C: /r

Last edited by kimsland; 11-23-2009 at 06:22 PM..
  #3  
Old 11-23-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
that still doesn't work... all it does is open a new window and then do the same thing.
  #4  
Old 11-23-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
Sorry, did you try "Call" as stated above?
I walked away and then thought, oh wait, call should do it

Are you running this batch file inside Windows, or from a bootcd
  #5  
Old 11-23-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
no... no program outside of the shell will run in batch. I can execute them just fine manually by typing in the program name into the prompt. But in a batch file it tries to execute over and over again. IF you leave echo on you can see it trying to run the command over and over and over to no effect.

it doesn't matter what it is... ping... notepad... any program outside of the shell fails to execute in batch.
  #6  
Old 11-23-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
You need an "Exit" command, at the end


By the way, I just tested this on XP, creating Test.bat, and all of them worked. You try:
Quote:
@echo off
Title: Notepad
echo.
echo Using CALL
call Notepad
pause
echo.
echo Using Start
Start Notepad
pause
echo.
echo using no command
Notepad
pause
echo.
exit
Save in Notepad > All files > Test.bat
  #7  
Old 11-24-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
Weird... ok, they all worked that time.

Several others are starting to work that were not working yesterday. The one that still won't run from batch is chkdsk.
  #8  
Old 11-24-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
I just tested CheckDisk, all 3 command, and it works
Try copying and pasting this one to Notepad
Maybe you had a spelling or syntax error?
Quote:
@echo off
Title: CheckDisk
echo.
echo Using CALL
call chkdsk /r
pause
echo.
echo Using Start
Start chkdsk /r
pause
echo.
echo using no command
chkdsk /r
pause
echo.
exit
Oh, just answer N when prompted to run it
  #9  
Old 11-24-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
It says "using call" over and over and over again... it's moving so fast it's just a blur on the screen.

It should be noted that I know how to use batch files. The old batch script was unchanged from one I used for years before a recent reinstall. After the reinstall batch files have become unpredictable. Mostly what happens is that endless cycling to execute a command that never gets executed.

You can see it sitting there trying again and again to launch it.
  #10  
Old 11-24-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
I'm very good at batch files too so these simple commands are annoying

Obviously you have an Exit command?
And I did put "pause" in there
I'm thinking that its "calling" another batch by the same name, ie chkdsk.bat, or something silly
  #11  
Old 11-24-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
No, it's not running through the whole batch file at warp speed. It's just running that ONE command that won't run over and over and over again.

For example, if I put Chkdsk /? on one line it wouldn't matter if I put exit on the next. It would never get there. IT would just cycle endlessly with "chkdsk /?". On another computer it displays the help text and then closes.


It's weird. I've checked the NTFS permissions of the file and it doesn't matter.
  #12  
Old 11-24-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
Quote:
Originally Posted by Karmashock View Post
After the reinstall batch files have become unpredictable.
Reinstall... Exactly what is your understanding of this?
Mine is removing the partition and then installing Windows clean
Maybe there's some Malware on your computer?
Batch files usually don't care a lot on Windows issues (although CheckDisk may help)
  #13  
Old 11-25-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
Well... I reinstalled on a fresh partition... then after a few weeks I ghosted that partition onto a level 1 raid.

I don't know when the issue started so I don't know if the ghosting did it. I don't understand how this could even be a problem. What the hell is wrong here...


bah...
  #14  
Old 11-25-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
Oh, Ghost and Raid, not a good match
I have seen ghosted images cause strange issues myself (being a Ghost imager myself)
What was it again?.... Um, something about the bootloader or Partition requiring a repair (at the time I used Partition Magic to fix errors without hurting my file system, but PM is now old and basically probably won't work)
You could use a free live BootCd like Gparted BootCD, to check your partitions, but with Raid (number?) I'm not to sure if you "fix" any issue without upsetting the filesystem

Your thoughts?
  #15  
Old 11-25-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
Well, it's raid 1... that is a simple mirror array. Further, it's a full hardware raid. Drivers aren't even needed to make the raid work. The array just looks like a single scsi harddrive to dos.

Beyond that i've scanned the drive a few times with Chkdsk and it doesn't find anything besides the incidental security errors... the sort of thing checkdisk always finds.

Also, the OS is booting off of this partition without a problem. I'm really very happy with this system. It's just a few weird things.

1. Chkdsk won't run from a batch file.

2. DVD burn operations lock up the computer when they reach 6 percent (5 coasters and counting.) I have to reboot to get the system responsive again. I don't know if this happened before or after the ghost but it didn't happen before reinstall.

3. ATI Catalyst Control Center errors out whenever it's loaded. Drivers work just fine but not CCC. It's odd. I'm certain that this at least worked before the ghost operation.

There might be more... for example MSCONFIG required that I set certain settings a few times before they took. Everything kept reverting back as if I hadn't gone in and disabled certain start up items. But that might be the new firewall/antivirus. I'm using Avira Antivir which I'm new to... I typically use Comodo or AVG. I'm also using Outpost firewall for the first time. I don't know if either of those programs monitor start up items and nixed the change without telling me.
  #16  
Old 11-25-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
Quote:
Originally Posted by Karmashock View Post
Beyond that i've scanned the drive a few times with Chkdsk and it doesn't find anything besides the incidental security errors... the sort of thing checkdisk always finds..
That's not exactly true
CheckDisk should not find any issues, unless something is faulty
You may have a faulty hard drive if you get this often (more than once)

AVG Remover: http://www.avg.com/filedir/util/supp...remover_en.exe
  #17  
Old 11-29-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
This installation has never had AVG installed on it. I'm currently using Avira antivir free.
  #18  
Old 11-29-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
Quote:
Originally Posted by Karmashock View Post
This installation has never had AVG installed on it. I'm currently using Avira antivir free.
Quote:
Originally Posted by Karmashock View Post
I typically use Comodo or AVG. I'm also using Outpost firewall for the first time.
Oh, sorry thought you were using AVG
  #19  
Old 11-29-2009
TechSpot Enthusiast
 
Member since: Feb 2006, 237 posts
that was on the old installation. So your guess is that this is some of my protection software going haywire?
  #20  
Old 11-29-2009
Ex-TechSpotter
 
Member since: Dec 2007, 18,354 posts
No my guess is that it may even be faulty Hard Drive (if CheckDisk reports and fixes faults regularly)
Here's info on >> Drive Diagnostics to test your HardDrive
Closed Thread
Page 1 of 2 1 2

Similar Topics
Topic Replies Forum
Virus - computer will not execute files 4 Virus and Malware Removal
Copying files via batch files 4 Windows OS
Certain programs won't execute/I.E. woes 14 Virus and Malware Removal
execute programs from local web page 8 Software Apps
cannot execute any programs in XP 1 Windows OS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
All times are GMT -4. The time now is 02:34 PM.