Jump to content

techbrainless

Member
  • Posts

    5
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Yemen

Everything posted by techbrainless

  1. Thanks to who replied, Especial Thanks to jaclaz (many more thanks) , allen2 && I apologize to all for my rough reply, It works like a charm ........... Again my thanks to jaclaz,allen2 I totally agree with you , I dont know even low level basics of batch script and i did not put any effort to learn it.....It was my mistake I am sure that your above reply encouraged me alot to start learning batch script and also to spend time trying to understanding the things and trying to solve the problems before post a question.
  2. Thanks allen2 for your reply, forget about echo command , the problem is that : NOTHING will be deleted after executing the batch file ?????????
  3. Thanks jaclaz for your reply , 1. I have copied the above code into empty batch file, saved it , double clicked on it ( batch file) , but nothing happened ( nothing got deleted) 2. I tried to copy , paste the above code into DOS prompt but it displayed error and got hang as the following D:\test>@echo off SETLOCAL ENABLEEXTENSIONS for /f "Tokens=*" %%A in ('dir /B /S /A:-D^|FIND /V "%~nx0"') do ECHO del /q "%% A" %%A was unexpected at this time. for /f "Tokens=*" %%A in ('dir /B /S /A:D') do ECHO rd /s /q "%%A" %%A was unexpected at this time.
  4. Thanks for your reply Let us assume that we have placed the .batch file at the location "D:\test\mybatch.bat" once you have browsed to the directory "test" , double clicking on the batch file "mybatch.bat" , it should delete all the contents of the directory "test" ("D:\test") off course the batch file should delete all the contents of "test" directory except itself "mybatch.bat"
  5. Hi All , I want to create a batch file , which do the following 1. first get the current working directory 2. delete all the contents(files, directories ,sub directories) of the current working directory by the way i have tested the following code but it does not work for me D:\test>for / d% i in (s *.*) DO del% i / Q / S / was unexpected at this time. D:\test>for / d% i in (s *.*) DO rd% i / was unexpected at this time. D:\test> Could you plz help me ? BTW I am using XP , and I want to apply the batch to XP , Vista , Win 7
×
×
  • Create New...