Not If exist checking

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

desmin

Thread Starter
Banned
Joined
Jul 10, 2007
Messages
57
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
 
Joined
Aug 17, 2001
Messages
7,486
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"
 
Joined
Aug 17, 2001
Messages
7,486
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.
 
Joined
Aug 17, 2001
Messages
7,486
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.
 
Joined
Aug 17, 2001
Messages
7,486
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
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top