Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

.bat file search and delete


  • Please log in to reply

#1
Bismillah

Bismillah

    Member

  • Member
  • PipPipPip
  • 514 posts
Im trying to make a .bat file that searches for the file called server.exe in roaming and then deletes it if anyone could help me out that would be great
  • 0

Advertisements


#2
MS-Free

MS-Free

    Member

  • Member
  • PipPipPip
  • 425 posts
I won't write it out for you, but here's the basic structure you'd employ, if I understand you correctly. The stuff in Italics you'll have to replace with the specifics of your scenario.

cd Roaming
REM Roaming = path to the roaming folder.
dir /s search criteria > temp.txt
REM Basically treat temp.txt as an external variable. Call it whatever you want.
set tmp =< temp.txt
REM tmp IS a variable.
del temp.txt
del %tmp%
REM Referance variables by surrounding them with %'s

I think that fits what your looking to do.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP