Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all
I'm trying to create a batch file that runs periodically, logging Wireless access points in the vincinity of my laptop and then uploading this log to ftp.
Ideally i want the batch file to first determine whether the computer has internet access and if it does then do the above, if not i want it to record the WAP data in the log. Then next time the batch file runs it will add the more recent data to the log and (if possible) upload to ftp.
So far what i have is:
netsh wlan show networks mode=bssid >E:\test.txt
which detects the local wireless access points but i have no idea how to do the rest as I am a comlete novice to this!
Anyone have any ideas??
If your interested in the background to this question:
I have found a great ruby script that locates Wireless Acess Points returning logitude and latitude (Just like the iphone/ipod touch). I am trying to create a way of tracking my laptop in case it gets stolen. I believe batch files will be best as they run with a default windows install, hence if all my software is wiped of the computer it still has a chance of running (this obviously assumes that the batch file is not deleted too). I've attempted to stop anyone just reinstalling windows by changing BIOS setting to not boot from CD drive (is this good enough?). A better option would be to get this to install even if the os is wiped clean (possibly using techniques used by viruses, MBR?? no idea)
Hope you can help me
Report Offensive Follow Up For Removal
I used to upload my dynamic IP on an ftp site so that I could connect to that pc remotely.
I think ICQ (The instant messenger) had an option called "run this program when the internet connection is established". I used to misuse this option to run my script and upload the ip info to the ftp site.
This is the batch file used to upload any file to a ftp site with username/password.
Hope this gives ideas on how to do it.
@echo off
if %1a==a goto usage
set datafile=%temp%\fxput.ftp
if exist %datafile% delete %datafile%
echo usename> %datafile%
echo password>> %datafile%
echo cd /www/gm/h/holla>> %datafile%
echo bin>> %datafile%
echo prompt>> %datafile%
echo put %1>> %datafile%
echo quit >> %datafile%
ftp -s:%datafile% the.ftp.site.address
goto quit
:usage
echo Usage:
echo %0 filename
echo will put filename in binary mode onto Holla's web home dir
:quit--
Holla.
Report Offensive Follow Up For Removal
Thanks Holla
I made some good progress today which is good for a complete novice. Still looking for a nice way to test internet connection as to determine whether to upload and delete the local file or just append new info to the local file for uploading later.Anyone else tried something like this?
please bear in mind that i am completely new to batch programming
Report Offensive Follow Up For Removal
RobJN,
Not a nice way,
but one crude way to check for internet connection is to get a file thru ftp from a remote server(use the above script, instead of put, use get). If you got the file(If exists filename), connection is there.
If you did not get the file, connection is not established.If ftping is difficult, just use the wget.exe (GNU) and do "wget http://google.com". If you got the index.html from google, connection exists.
--
Holla.
Report Offensive Follow Up For Removal
or just use ping, and if you get a connection it exists.
I only Batch if possible, 2000 more lines of code, oh well.
Report Offensive Follow Up For Removal
I like that idea Holla,
It doesn't have to be nice, as long as it works and i can figure out how to do it, which for your idea i should be able to figure out pretty easily. Knew their would be a good way of doing this, just needed to think outside of the box.
Thanks again
Report Offensive Follow Up For Removal
![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |