Tech Support Guy banner
Status
Not open for further replies.

Not If exist checking

2K views 5 replies 3 participants last post by  Mosaic1 
#1 ·
im making another script to go along with my google search script but it isnt working
here my code
Code:
@echo off
TITLE test

if exist http://www.eliteknifesquad.com/EKSwall.zip goto exit

:exit
DEL "C:\Documents and Settings\Billy\Desktop\del\del.txt"
its not checking if that exists (which it doesnt)and just deletes it anyway

can the cmd even access internet besides command PING
at ip refresh and that stuff
thx in advance
 
#2 ·
Code:
@echo off
TITLE test

if exist http://www.eliteknifesquad.com/EKSwall.zip goto exit

:exit
DEL "C:\Documents and Settings\Billy\Desktop\del\del.txt"
Either way it's going to delete that file. After the goto, you need to stop the rest of the code from running, or it will. Dos keeps running the commands in order as listed unless you direct it otherwise.

Like this example:

Code:
if  exist http://www.eliteknifesquad.com/EKSwall.zip goto last
exit

:last
DEL "C:\Documents and Settings\Billy\Desktop\del\del.txt"
 
#3 ·
I'm not sure you can check for a file on the web like that using If Exist. I'll have to play and see.

EDIT: Nope. Exactly what did you want to do? Are you just checking to see if a file exists and if it does, then delete another file on your desktop?

Look at downloading a utility named Wget tp download files.
 
#4 ·
You can use WGET with the Spider Switch ( no file is downloaded) and the -o switch to output to a text file. (to capture the Server Response) Then you can use the find utility to check the output file for Not Found to determine if the File was found or not and act accordingly.

The rest is up to you. Hope this helps.
 
#6 ·
Hi Squashman,

That link is to some code which would be used if you had a programming language named BlitzBasic installed.

They happened to have written the code and named the function If Exist as a coincidence.

However, Windows won't know what to do with that code unless it's used with the correct files installed to interpret.


Mo
 
Status
Not open for further replies.
You have insufficient privileges to reply here.
Top