Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 2nd, 2008, 08:23 PM
Member
 
Join Date: Dec 2006
Posts: 81
Default Recursive .Bat file error

hi, I'm trying to get a bat file together that pings every 5 minutes, and will reboot the pc if a ping is not found, I get an error:

"The process cannot access the file because it is being used by another process.",

when I try to run this bat file called "ping.bat":

Code:
@echo off
ping -n 1 -w 300000 www.google.com | find "could not find host" > null && call shutdown -r -t 0 -f
call ping.bat
any assistance will be greatly appreciated
Reply
  #2  
Old September 3rd, 2008, 03:57 AM
Stang02GT's Avatar
Moderator
 
Join Date: Jun 2007
Location: USA
Age: 23
Posts: 1,115
Default

well since you are making a call to that bat file in this bat file, why would you need to run it separately?

Or am I misunderstanding?
Reply
  #3  
Old September 3rd, 2008, 08:10 AM
Familiar Sight
 
Join Date: Mar 2008
Posts: 244
Default

Quote:
Originally Posted by cnixuser
hi, I'm trying to get a bat file together that pings every 5 minutes, and will reboot the pc if a ping is not found, I get an error:


Code:
@echo off
ping -n 1 -w 300000 www.google.com | find "could not find host" > null && call shutdown -r -t 0 -f
call ping.bat
any assistance will be greatly appreciated
why not just use goto?


Code:
@echo off
:start
ping -n 1 -w 300000 www.google.com | find "could not find host" > null && call shutdown -r -t 0 -f
goto start
Reply
  #4  
Old September 3rd, 2008, 08:12 AM
Familiar Sight
 
Join Date: Mar 2008
Posts: 244
Default

also you might want to look at vbscript as it is pretty easy and gives you more control

http://www.robvanderwoude.com/vbstech_network_ping.html

Last edited by Nepomuk; September 3rd, 2008 at 03:02 PM. Reason: Please use the URL tags
Reply
  #5  
Old September 3rd, 2008, 02:24 PM
Stang02GT's Avatar
Moderator
 
Join Date: Jun 2007
Location: USA
Age: 23
Posts: 1,115
Default

Quote:
Originally Posted by jg007
also you might want to look at vbscript as it is pretty easy and gives you more control

http://www.robvanderwoude.com/vbstech_network_ping.html
Hey jg007,

I don't have MOD rights in this forum to change it but are you aware that you can actually insert a hyperlink into your posts?

Next time you go to post a link there is a picture of a planet(earth) at the top of the post box. If you use that it will set you through inserting a useable hyper link.

Just a note so that people don't have to copy and paste the url.
Reply
  #6  
Old September 3rd, 2008, 03:04 PM
Nepomuk's Avatar
Moderator
 
Join Date: Aug 2007
Location: Germany
Age: 21
Posts: 1,817
Default

Quote:
Originally Posted by Stang02GT
I don't have MOD rights in this forum to change it but are you aware that you can actually insert a hyperlink into your posts?
Well, I do. ^^ So, I've added the URL tags. As Stang02GT said, please use them.

Greetings,
Nepomuk
Reply
  #7  
Old September 3rd, 2008, 05:08 PM
Stang02GT's Avatar
Moderator
 
Join Date: Jun 2007
Location: USA
Age: 23
Posts: 1,115
Default

Quote:
Originally Posted by Nepomuk
Well, I do. ^^ So, I've added the URL tags. As Stang02GT said, please use them.

Greetings,
Nepomuk
Thank you Nepomuk!!!!!!!
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles