• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Batch file to ping network

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
Hi Guys,

I need some help writing a batch file to test network connectivity for various locations.
Basically we are transitioning to from an existing network provider to a new network provider.

What I would like the script to do

Ping a list of IP address and then output the results into a simple text file of each IP Address.

The text file ideally should just display
something along the lines of

ping www.google.com Successful

or

ping www.google.com Unsuccessful

This is what I have so far but it is a bit broken.
Code:
@echo off
Title Cut over to Telstra Check

set OutputFile=result.txt
cd\
CLS

Echo. Cut over test
Echo. 
Echo. Ping all sites
Pause
Ping www.google.com.au | find "Reply"
	echo ping to google successful >>"C:\nettest\OutputFile.txt"

	IF NOT echo ping to google unsuccessful >>"C:\nettest\OutputFile.txt"

Ping www.techpowerup.com | find "Reply"
	echo ping to TechPowerup successful >>"C:\nettest\OutputFile.txt"

	IF NOT echo ping to Techpowerup unsuccessful >>"C:\nettest\OutputFile.txt"
pause

I'm not sure how to do a IF NOT command and make it jump to the next line.

Thanks!
 
Joined
Dec 27, 2008
Messages
587 (0.11/day)
System Name PC
Processor i5 2500k
Motherboard P8Z68-V PRO/GEN3
Cooling Fans
Memory DDR3-1600 (8GB)
Video Card(s) Sapphire Nitro+ RX 580
Storage HD103SJ
Display(s) XG2402
Case Xigmatek Midgard II
Power Supply PC Power & Cooling Silencer 750W
I don't know much about programming, but what about an "Else" statement?

This guy knows more: Batch files branching
 

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
haha we are on the same boat, I'm clueless when it comes to programming.

I'll give it a go =)
 
Joined
Nov 4, 2005
Messages
11,655 (1.73/day)
System Name Compy 386
Processor 7800X3D
Motherboard Asus
Cooling Air for now.....
Memory 64 GB DDR5 6400Mhz
Video Card(s) 7900XTX 310 Merc
Storage Samsung 990 2TB, 2 SP 2TB SSDs and over 10TB spinning
Display(s) 56" Samsung 4K HDR
Audio Device(s) ATI HDMI
Mouse Logitech MX518
Keyboard Razer
Software A lot.
Benchmark Scores Its fast. Enough.

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
Thats a good idea however could we make the text file name indicate if it was successful or not or is that the complicated bit?

Also on another note would it be easier to do this in vb script?
 
Joined
Nov 4, 2005
Messages
11,655 (1.73/day)
System Name Compy 386
Processor 7800X3D
Motherboard Asus
Cooling Air for now.....
Memory 64 GB DDR5 6400Mhz
Video Card(s) 7900XTX 310 Merc
Storage Samsung 990 2TB, 2 SP 2TB SSDs and over 10TB spinning
Display(s) 56" Samsung 4K HDR
Audio Device(s) ATI HDMI
Mouse Logitech MX518
Keyboard Razer
Software A lot.
Benchmark Scores Its fast. Enough.
No, batch files are extremely easy.

A "If" requires three extra steps.

Code is not how much you can put in, but how lite can you make it and still perform the functions.

So

@ echo off


ping 1.4.1.4 >a.txt

findstr /m "Request timed out" a.txt
if %errorlevel%%==0 (
echo Save our nets!!!
)

pause
 

Mindweaver

Moderato®™
Staff member
Joined
Apr 16, 2009
Messages
8,193 (1.50/day)
Location
Charleston, SC
System Name Tower of Power / Sechs
Processor i7 14700K / i7 5820k @ 4.5ghz
Motherboard ASUS ROG Strix Z690-A Gaming WiFi D4 / X99S GAMING 7
Cooling CM MasterLiquid ML360 Mirror ARGB Close-Loop AIO / CORSAIR Hydro Series H100i Extreme
Memory CORSAIR Vengeance LPX 32GB (2 x 16GB) DDR4 3600 / G.Skill DDR4 2800 16GB 4x4GB
Video Card(s) ASUS TUF Gaming GeForce RTX 4070 Ti / ASUS TUF Gaming GeForce RTX 3070 V2 OC Edition
Storage 4x Samsung 980 Pro 1TB M.2, 2x Crucial 1TB SSD / Samsung 870 PRO 500GB M.2
Display(s) Samsung 32" Odyssy G5 Gaming 144hz 1440p, ViewSonic 32" 72hz 1440p / 2x ViewSonic 32" 72hz 1440p
Case Phantek "400A" / Phanteks “Enthoo Pro series”
Audio Device(s) Realtek ALC4080 / Azalia Realtek ALC1150
Power Supply Corsair RM Series RM750 / Corsair CXM CX600M
Mouse Glorious Gaming Model D Wireless / Razer DeathAdder Chroma
Keyboard Glorious GMMK with box-white switches / Keychron K6 pro with blue swithes
VR HMD Quest 3 (128gb) + Rift S + HTC Vive + DK1
Software Windows 11 Pro x64 / Windows 10 Pro x64
Benchmark Scores Yes
You need to use GOTO :toast:

EDIT: I would write an example.. but I'm off to bed. If you are still having problems tomorrow. I'll chime in. :toast: Steevo is on the right track! :toast:
 

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
Okay... getting confused, Sorry I'm a noob programmer.

I've copied Steevo code and tried to modify it to suit my requirements and it isn't working. I presume I'm suppose to use the goto command

Code:
@echo off

echo testing 1.4.1.4
ping 1.4.1.4 >a.txt

findstr /m "Request timed out" a.txt
if %errorlevel%%==0 (
echo Save our nets!!!
)

echo testing google
ping www.google.com.au >google.txt

findstr /m "Request timed out" google.txt
if %errorlevel%%==0 (
echo Save our nets!!!
)

findstr /m "Reply from" google.txt
if %errorlevel%%==0 (
echo yay google working!!!

pause

I understand that the idea is to make it as light as possible but the reason why I'm trying to make it as automated as possible is because we plan on level 1 people to test network connectivity at a few different sites as we are short on resources and we are required to do all of this on a Saturday morning (my usual catch up on sleep time).

I just realized i'm going to need to make the bat files create text files.

edit okay simple fix would be to put del *.txt which would delete all text files and pretty much refresh it all the time at the beginning.
 
Last edited:
Joined
Nov 4, 2005
Messages
11,655 (1.73/day)
System Name Compy 386
Processor 7800X3D
Motherboard Asus
Cooling Air for now.....
Memory 64 GB DDR5 6400Mhz
Video Card(s) 7900XTX 310 Merc
Storage Samsung 990 2TB, 2 SP 2TB SSDs and over 10TB spinning
Display(s) 56" Samsung 4K HDR
Audio Device(s) ATI HDMI
Mouse Logitech MX518
Keyboard Razer
Software A lot.
Benchmark Scores Its fast. Enough.
Just reuse the same name and it will overwrite the files each time the batch is run.
 

CaptainFailcon

New Member
Joined
Apr 27, 2012
Messages
194 (0.04/day)
you would be better off writing something in c++ or even VB
batch file != programming
batch files are extremely limited
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
13,147 (2.96/day)
Location
Concord, NH, USA
System Name Apollo
Processor Intel Core i9 9880H
Motherboard Some proprietary Apple thing.
Memory 64GB DDR4-2667
Video Card(s) AMD Radeon Pro 5600M, 8GB HBM2
Storage 1TB Apple NVMe, 4TB External
Display(s) Laptop @ 3072x1920 + 2x LG 5k Ultrafine TB3 displays
Case MacBook Pro (16", 2019)
Audio Device(s) AirPods Pro, Sennheiser HD 380s w/ FIIO Alpen 2, or Logitech 2.1 Speakers
Power Supply 96w Power Adapter
Mouse Logitech MX Master 3
Keyboard Logitech G915, GL Clicky
Software MacOS 12.1
You could install Cygwin and use BASH which is much more capable of doing what you're describing. I've actually written a script that does something like this using Ruby, where it takes in a list of IPs and returns a list of connected or disconnected users in either easy to read or XML format. Maybe something like that is what you're looking for? This is unmodified but might suit your purposes on a POSIX machine with BASH and Ping.

Code:
#!/usr/bin/ruby1.9.1
require "nokogiri"

ipfile = File.open('/etc/openvpn/ipp.txt')
threads = Array.new
results = Array.new

connected = false
disconnected = false
as_xml = false

ARGV.each do |arg|
  case arg
  when "--xml"
    as_xml = true
  when "--connected"
    connected = true
  when "--disconnected"
    disconnected = true
  end
end

if !connected and !disconnected
  print "Usage: ovpn-stat.rb [--connected] [--disconnected] [--xml]\n"
  print "    --(dis)connected displays users who fit that connection status.\n"
  print "    --xml returns the result as xml.\n"
  exit
end

ipfile.each do |line|
  threads << Thread.new do
    splitted = line.split(',')
    result = `ping -q -c 1 #{splitted[1]}`
    if($?.exitstatus == 0)
      cstr = "Connected"
    else
      cstr = "Disconnected"
    end
    r = Hash.new
    r["user"] = splitted[0]
    r["ip"] = splitted[1].sub(/\n/, '')
    r["status"] = cstr
    if (cstr == "Connected" and connected) or (cstr == "Disconnected" and discon                                                                                                                                   nected)
      results << r
    end
  end
end

threads.each do |i|
  i.join
end

if as_xml
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.vpnclients {
      results.each do |ci|
      xml.client {
        xml.user ci["user"]
        xml.ip ci["ip"]
        xml.status ci["status"]
      }
      end
    }
  end
  print builder.to_xml
  exit
end

results.each do |i|
  print "#{i["user"]}@#{i["ip"]} - #{i["status"]}\n"
end

It's not quite what you need since it reads the OpenVPN ipp.txt file (all users and their ips since ips are persistent between sessions and it overrides the DHCP server.) With a few modifications this could be something you could use.
 

Mindweaver

Moderato®™
Staff member
Joined
Apr 16, 2009
Messages
8,193 (1.50/day)
Location
Charleston, SC
System Name Tower of Power / Sechs
Processor i7 14700K / i7 5820k @ 4.5ghz
Motherboard ASUS ROG Strix Z690-A Gaming WiFi D4 / X99S GAMING 7
Cooling CM MasterLiquid ML360 Mirror ARGB Close-Loop AIO / CORSAIR Hydro Series H100i Extreme
Memory CORSAIR Vengeance LPX 32GB (2 x 16GB) DDR4 3600 / G.Skill DDR4 2800 16GB 4x4GB
Video Card(s) ASUS TUF Gaming GeForce RTX 4070 Ti / ASUS TUF Gaming GeForce RTX 3070 V2 OC Edition
Storage 4x Samsung 980 Pro 1TB M.2, 2x Crucial 1TB SSD / Samsung 870 PRO 500GB M.2
Display(s) Samsung 32" Odyssy G5 Gaming 144hz 1440p, ViewSonic 32" 72hz 1440p / 2x ViewSonic 32" 72hz 1440p
Case Phantek "400A" / Phanteks “Enthoo Pro series”
Audio Device(s) Realtek ALC4080 / Azalia Realtek ALC1150
Power Supply Corsair RM Series RM750 / Corsair CXM CX600M
Mouse Glorious Gaming Model D Wireless / Razer DeathAdder Chroma
Keyboard Glorious GMMK with box-white switches / Keychron K6 pro with blue swithes
VR HMD Quest 3 (128gb) + Rift S + HTC Vive + DK1
Software Windows 11 Pro x64 / Windows 10 Pro x64
Benchmark Scores Yes
I usually don't like doing all the work for someone.. but I thought this project would be fun! Plus, I wanted to show the power of a batch file! hehehe There's a lot of easier languages out there and we are all quick to say, "Do it in vb or c# or so on". ...But Some times it's good to write a batch file just because.. hehehe

Code:
@ECHO off

::============================================
:: \\\\\\\\\\\\\\   Variables   //////////////
::============================================
SET drive=c:\nettest
SET OutputFile=result.txt
SET tt=%time:~0,2%_%time:~3,2%_result.txt
SET folder=%date:/=-% %tt%
SET site1=www.google.com
SET site2=www.techpowerup.com


::============================================
:: \\\\\\\\\\\\\\   Message   ////////////////
::============================================

COLOR 9F
ECHO. Welcome to Mindweaver's
ECHO. Cut over test
ECHO. 
ECHO. Ping all sites
PAUSE

GOTO Google

::==================================================
:: \\\\\\\\\\\\\\   Pinging Google  ////////////////
::==================================================
:Google
PING -n 2 %site1% | find "Reply from"

::Check to see if ping was successful or unsuccesful
::successful = :found1
::unsuccessful = :nfound1
IF NOT ERRORLEVEL 1 GOTO found1
IF ERRORLEVEL 1 GOTO nfound1


::Check to see if folder exists
:found1
ECHO.
ECHO Google found!
ECHO.
IF EXIST "%drive%\%folder%" GOTO :write1
IF NOT EXIST "%drive%\%folder%\" GOTO :create1

		::Folder found - writes output
		:write1
		ECHO ping to google successful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
		GOTO techpowerup

		::Folder not found - creates folder and writes output
		:create1
		MD "%drive%\%folder%\"
			
		ECHO ping to google successful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
		GOTO techpowerup

:nfound1
ECHO.
ECHO ###Google NOT FOUND!
ECHO.
IF EXIST "%drive%\%folder%" GOTO :write2
IF NOT EXIST "%drive%\%folder%\" GOTO :create2

		:write2
		ECHO ping to google unsuccessful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
		GOTO techpowerup

		:create2
		MD "%drive%\%folder%\"

		ECHO ping to google unsuccessful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
		GOTO techpowerup

::========================================================
:: \\\\\\\\\\\\\\   Pinging Techpowerup!  ////////////////
::========================================================
:techpowerup
PING -n 2 %site2% | find "Reply from"
IF NOT ERRORLEVEL 1 GOTO found2
IF ERRORLEVEL 1 GOTO nfound2
:found2
ECHO.
ECHO Techpowerup! found!
ECHO ping to Techpowerup! successful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
GOTO Finished

:nfound2
ECHO.
ECHO ###Techpowerup! NOT FOUND!
ECHO ping to Techpowerup! unsuccessful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
GOTO Finished


::==========================================================
:: \\\\\\\\\\\\\\   Cut over test finished  ////////////////
::==========================================================
:Finished
ECHO.
ECHO Cut over test Completed!
ECHO.

@PAUSE

::========================================================================
:: \\\\\\\\\\\\\\   Created by Mindweaver @ Techpowerup!  ////////////////
::========================================================================

EDIT: Added file to download. :toast:
 

Attachments

  • Nettest.zip
    827 bytes · Views: 1,291
Last edited:

Completely Bonkers

New Member
Joined
Feb 6, 2007
Messages
2,576 (0.41/day)
Processor Mysterious Engineering Prototype
Motherboard Intel 865
Cooling Custom block made in workshop
Memory Corsair XMS 2GB
Video Card(s) FireGL X3-256
Display(s) 1600x1200 SyncMaster x 2 = 3200x1200
Software Windows 2003
Man deserves credit
 

Mindweaver

Moderato®™
Staff member
Joined
Apr 16, 2009
Messages
8,193 (1.50/day)
Location
Charleston, SC
System Name Tower of Power / Sechs
Processor i7 14700K / i7 5820k @ 4.5ghz
Motherboard ASUS ROG Strix Z690-A Gaming WiFi D4 / X99S GAMING 7
Cooling CM MasterLiquid ML360 Mirror ARGB Close-Loop AIO / CORSAIR Hydro Series H100i Extreme
Memory CORSAIR Vengeance LPX 32GB (2 x 16GB) DDR4 3600 / G.Skill DDR4 2800 16GB 4x4GB
Video Card(s) ASUS TUF Gaming GeForce RTX 4070 Ti / ASUS TUF Gaming GeForce RTX 3070 V2 OC Edition
Storage 4x Samsung 980 Pro 1TB M.2, 2x Crucial 1TB SSD / Samsung 870 PRO 500GB M.2
Display(s) Samsung 32" Odyssy G5 Gaming 144hz 1440p, ViewSonic 32" 72hz 1440p / 2x ViewSonic 32" 72hz 1440p
Case Phantek "400A" / Phanteks “Enthoo Pro series”
Audio Device(s) Realtek ALC4080 / Azalia Realtek ALC1150
Power Supply Corsair RM Series RM750 / Corsair CXM CX600M
Mouse Glorious Gaming Model D Wireless / Razer DeathAdder Chroma
Keyboard Glorious GMMK with box-white switches / Keychron K6 pro with blue swithes
VR HMD Quest 3 (128gb) + Rift S + HTC Vive + DK1
Software Windows 11 Pro x64 / Windows 10 Pro x64
Benchmark Scores Yes

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
I really appreciate it, your 50x better than mine.
I never mean't for someone to write the entire code just point me in the right direction.

May I ask for me to add more sites do I just add more set like below?

SET site3=www.hotmail.com
SET site4=www.awesomer.com

edit: sorry just read the code carefully, need to lots of copy paste. Thanks all!
 
Last edited:

Mindweaver

Moderato®™
Staff member
Joined
Apr 16, 2009
Messages
8,193 (1.50/day)
Location
Charleston, SC
System Name Tower of Power / Sechs
Processor i7 14700K / i7 5820k @ 4.5ghz
Motherboard ASUS ROG Strix Z690-A Gaming WiFi D4 / X99S GAMING 7
Cooling CM MasterLiquid ML360 Mirror ARGB Close-Loop AIO / CORSAIR Hydro Series H100i Extreme
Memory CORSAIR Vengeance LPX 32GB (2 x 16GB) DDR4 3600 / G.Skill DDR4 2800 16GB 4x4GB
Video Card(s) ASUS TUF Gaming GeForce RTX 4070 Ti / ASUS TUF Gaming GeForce RTX 3070 V2 OC Edition
Storage 4x Samsung 980 Pro 1TB M.2, 2x Crucial 1TB SSD / Samsung 870 PRO 500GB M.2
Display(s) Samsung 32" Odyssy G5 Gaming 144hz 1440p, ViewSonic 32" 72hz 1440p / 2x ViewSonic 32" 72hz 1440p
Case Phantek "400A" / Phanteks “Enthoo Pro series”
Audio Device(s) Realtek ALC4080 / Azalia Realtek ALC1150
Power Supply Corsair RM Series RM750 / Corsair CXM CX600M
Mouse Glorious Gaming Model D Wireless / Razer DeathAdder Chroma
Keyboard Glorious GMMK with box-white switches / Keychron K6 pro with blue swithes
VR HMD Quest 3 (128gb) + Rift S + HTC Vive + DK1
Software Windows 11 Pro x64 / Windows 10 Pro x64
Benchmark Scores Yes
I really appreciate it, your 50x better than mine.
I never mean't for someone to write the entire code just point me in the right direction.

May I ask for me to add more sites do I just add more set like below?

SET site3=www.hotmail.com
SET site4=www.awesomer.com

edit: sorry just read the code carefully, need to lots of copy paste. Thanks all!

No problem Yin. Like I said it sparked my interest.. hehehe Plus, I started out pointing you in the right direction with GOTO. ;) But about adding more sites. Just copy
Code:
::========================================================
:: \\\\\\\\\\\\\\   Pinging Techpowerup!  ////////////////
::========================================================
:techpowerup
PING -n 2 %site2% | find "Reply from"
IF NOT ERRORLEVEL 1 GOTO found2
IF ERRORLEVEL 1 GOTO nfound2
:found2
ECHO.
ECHO Techpowerup! found!
ECHO ping to Techpowerup! successful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
GOTO Finished

:nfound2
ECHO.
ECHO ###Techpowerup! NOT FOUND!
ECHO ping to Techpowerup! unsuccessful on Date (%date%), Time (%time%). >>"%drive%\%folder%\%tt%" 
GOTO Finished
down and then paste it below. Then change where it says, "Techpowerup!" and "site2". You will need to create a new "site3" Variable and your done. :toast:
 
  • Like
Reactions: Yin

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
Ok... Noob question

How do I make Mindweaver's script create a folder where the bat file is.

eg. we have the bat file on a usb g:\nettest.bat. So the logs save on g:\ instead of c:\.

I tried changing SET drive to = \

but that just breaks the entire script.
 

Yin

Joined
Feb 19, 2006
Messages
540 (0.08/day)
Processor Intel i7 920
Motherboard ASUS RAMPAGE II Extreme
Cooling CM v10
Memory Corsair 3 x 2GB TR3X6G1866C9DF
Video Card(s) Nvidia XFX 8800GT Stock
Storage Seagate ST3500320AS, 2 x Samsung HD103UJ
Display(s) 2408WFP
Case Corsair 800D
Power Supply Corsair HX750W
Sorry, I must of not made that clear.

I meant that the value would be a variable depending on where you run the bat file from.

the usb or the file may not be on g: it could be e: or f:.

I don't know if that made any sense.....
 

Mindweaver

Moderato®™
Staff member
Joined
Apr 16, 2009
Messages
8,193 (1.50/day)
Location
Charleston, SC
System Name Tower of Power / Sechs
Processor i7 14700K / i7 5820k @ 4.5ghz
Motherboard ASUS ROG Strix Z690-A Gaming WiFi D4 / X99S GAMING 7
Cooling CM MasterLiquid ML360 Mirror ARGB Close-Loop AIO / CORSAIR Hydro Series H100i Extreme
Memory CORSAIR Vengeance LPX 32GB (2 x 16GB) DDR4 3600 / G.Skill DDR4 2800 16GB 4x4GB
Video Card(s) ASUS TUF Gaming GeForce RTX 4070 Ti / ASUS TUF Gaming GeForce RTX 3070 V2 OC Edition
Storage 4x Samsung 980 Pro 1TB M.2, 2x Crucial 1TB SSD / Samsung 870 PRO 500GB M.2
Display(s) Samsung 32" Odyssy G5 Gaming 144hz 1440p, ViewSonic 32" 72hz 1440p / 2x ViewSonic 32" 72hz 1440p
Case Phantek "400A" / Phanteks “Enthoo Pro series”
Audio Device(s) Realtek ALC4080 / Azalia Realtek ALC1150
Power Supply Corsair RM Series RM750 / Corsair CXM CX600M
Mouse Glorious Gaming Model D Wireless / Razer DeathAdder Chroma
Keyboard Glorious GMMK with box-white switches / Keychron K6 pro with blue swithes
VR HMD Quest 3 (128gb) + Rift S + HTC Vive + DK1
Software Windows 11 Pro x64 / Windows 10 Pro x64
Benchmark Scores Yes
Sorry, I must of not made that clear.

I meant that the value would be a variable depending on where you run the bat file from.

the usb or the file may not be on g: it could be e: or f:.

I don't know if that made any sense.....

Use "%~dp0" to find out where the file lives. Change "SET drive=c:\nettest" to "SET drive=%~dp0". You will also need to change "%drive%\" to "%drive%" because "%~dp0" will put the "\" for you. After changing "SET drive=c:\nettest" to "SET drive=%~dp0", I would do a search and replace all "%drive%\" with "%drive%". :toast:
 

ondove

New Member
Joined
Sep 10, 2014
Messages
1 (0.00/day)
thanks a bunch for this , made my job a whole lot easier, got a network of keyboardless computers and onscreen keybord sucks after computer #10.
 
Top