dos for command error from batch file
Results 1 to 2 of 2

Thread: dos for command error from batch file

  1. #1
    Join Date
    Dec 2005
    Posts
    53

    dos for command error from batch file

    i have this dos command which will automatically scan ips in the given range .


    FOR /L %i IN (42,1,46) DO ping -a 192.168.1.%i

    it runs ok from command prompt,but when i try to run it from a batch file ,it gives an error w.r.t to varaible i.

    can any one help me with creating a batch file

  2. #2
    Join Date
    Nov 1999
    Location
    Stephens City, VA, USA
    Posts
    619
    You need to double the % when used in a batch file:

    for /L %%i in (42,1,46) do ping -a 192.168.1.%%i
    dcj2
    -------
    Do I contradict myself?
    Very well then I contradict myself,
    (I am large, I contain multitudes.)
    --Walt Whitman, "Song of Myself"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •