find file in drive then get its path

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
starxultra
Posts: 1
Joined: 13 Oct 2021 00:52

find file in drive then get its path

#1 Post by starxultra » 13 Oct 2021 01:01

Heloo, I am building antivirus in bat and want to check if a certain file exists in the system

I want something like this

Code: Select all

results = find("myfile.exe")
if %results% not empty
path = "myfile.exe".path

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: find file in drive then get its path

#2 Post by aGerman » 13 Oct 2021 03:10

starxultra wrote:
13 Oct 2021 01:01
I am building antivirus in bat
Don't! :shock:
starxultra wrote:
13 Oct 2021 01:01
want to check if a certain file exists in the system
Have a look at this thread:
viewtopic.php?f=3&t=10147

Steffen

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: find file in drive then get its path

#3 Post by Squashman » 13 Oct 2021 07:38

You could start by writing actual batch file code instead of pseudo code. Not a single line of your code would execute correctly.

Hackoo
Posts: 103
Joined: 15 Apr 2014 17:59

Re: find file in drive then get its path

#4 Post by Hackoo » 15 Oct 2021 15:11

Hi :wink:
Take a look at this thread that can give you an idea for making your own code in the futur !
Batch Antivirus

Post Reply