<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to write a batch file in windows?? in Operating System - Microsoft</title>
    <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850038#M7435</link>
    <description>Glad to help, and welcome to the forum.&lt;BR /&gt;&lt;BR /&gt;If you'd like to help other members with questions, and you're interesed in earning points, here's how:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Jon</description>
    <pubDate>Mon, 28 Aug 2006 11:33:02 GMT</pubDate>
    <dc:creator>Jon Finley</dc:creator>
    <dc:date>2006-08-28T11:33:02Z</dc:date>
    <item>
      <title>how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850022#M7419</link>
      <description>How to write a .batch file in windows that will delete all files including hidden files. How to write next .batch file for compressing all files in directory and then send them trough ftp???</description>
      <pubDate>Thu, 24 Aug 2006 12:01:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850022#M7419</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-24T12:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850023#M7420</link>
      <description>Hi Kabucek,&lt;BR /&gt;&lt;BR /&gt;  Batch file is nothing but a way of executing combination of commands.&lt;BR /&gt;&lt;BR /&gt;For instance a delete command like what you want....&lt;BR /&gt;&lt;BR /&gt;say you want to delete all files in a particular folder(abc)&lt;BR /&gt;so open notepad --- type---del c:\abc\*.*&lt;BR /&gt;&lt;BR /&gt;Save this file as del.bat with file type as all files.&lt;BR /&gt;&lt;BR /&gt;Similarly you can use other command along with it in the same batch file ---compressing command and ftp commands...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;V&lt;BR /&gt;(Points appreciated :)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Aug 2006 13:18:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850023#M7420</guid>
      <dc:creator>Vinay N</dc:creator>
      <dc:date>2006-08-24T13:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850024#M7421</link>
      <description>See if these work for you:&lt;BR /&gt;--------------------------------&lt;BR /&gt;&lt;BR /&gt;@echo off&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: Delete all files within a folder&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;set /P my_folder="Please enter folder to delete files within: "&lt;BR /&gt;&lt;BR /&gt;if exist %my_folder% goto do_dfile&lt;BR /&gt;goto error&lt;BR /&gt;&lt;BR /&gt;:do_dfile&lt;BR /&gt;&lt;BR /&gt;cd %my_folder%&lt;BR /&gt;&lt;BR /&gt;del /F *.*&lt;BR /&gt;del /F /AH *.*&lt;BR /&gt;&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;:error&lt;BR /&gt;echo Folder was not found.&lt;BR /&gt;&lt;BR /&gt;:done&lt;BR /&gt;&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: End of delete script&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;==============================================================&lt;BR /&gt;&lt;BR /&gt;@echo off&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: Compress (Zip?) then FTP files&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;set /P my_folder="Please enter folder to zip and FTP: "&lt;BR /&gt;&lt;BR /&gt;if exist %my_folder% goto do_zfile&lt;BR /&gt;goto error&lt;BR /&gt;&lt;BR /&gt;:do_zfile&lt;BR /&gt;&lt;BR /&gt;cd %my_folder%&lt;BR /&gt;&lt;BR /&gt;rem .: if your date has '/' in the date, they need to be stripped out.&lt;BR /&gt;for /f "delims='/'" %%i in ('%date%') do&lt;BR /&gt;set my_date=%%i-%%j-%%k&lt;BR /&gt;&lt;BR /&gt;zip_program /switches *.* %my_date%.zip&lt;BR /&gt;&lt;BR /&gt;set /P my_loc="Please enter FTP site: "&lt;BR /&gt;set /P my_id="Please enter your ID: "&lt;BR /&gt;set /P my_pass="Please enter your Password: "&lt;BR /&gt;&lt;BR /&gt;echo open %my_loc% &amp;gt; ftp_conn.txt&lt;BR /&gt;echo user %my_id% %my_pass%&amp;gt;&amp;gt; ftp_conn.txt&lt;BR /&gt;echo binary &amp;gt;&amp;gt; ftp_conn.txt&lt;BR /&gt;echo hash &amp;gt;&amp;gt; ftp_conn.txt&lt;BR /&gt;echo put %my_date%.zip &amp;gt;&amp;gt; ftp_conn.txt&lt;BR /&gt;echo close &amp;gt;&amp;gt; ftp_conn.txt&lt;BR /&gt;echo quit &amp;gt;&amp;gt; ftp_conn.txt&lt;BR /&gt;&lt;BR /&gt;ftp -s:ftp_conn.txt&lt;BR /&gt;&lt;BR /&gt;del ftp_conn.txt&lt;BR /&gt;del %my_date%.zip&lt;BR /&gt;&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;:error&lt;BR /&gt;echo Folder was not found.&lt;BR /&gt;&lt;BR /&gt;:done&lt;BR /&gt;&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: End of zip/ftp script&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Thu, 24 Aug 2006 14:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850024#M7421</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-24T14:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850025#M7422</link>
      <description>when i type del *.* /s it isn't deleting directories!! why ????&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Aug 2006 14:30:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850025#M7422</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-24T14:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850026#M7423</link>
      <description>Del doesn't go recursively.&lt;BR /&gt;&lt;BR /&gt;Tyep&lt;BR /&gt;&lt;BR /&gt;del /s *.*</description>
      <pubDate>Fri, 25 Aug 2006 01:04:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850026#M7423</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2006-08-25T01:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850027#M7424</link>
      <description>If you want to remove the directories rather than just delete the contents of directories, you need to use rm or rmdir&lt;BR /&gt;&lt;BR /&gt;rmdir my_folder or&lt;BR /&gt;rmdir /s my_folder&lt;BR /&gt;&lt;BR /&gt;This will also remove the specified folder, so if you are in the folder, you need to go up a level ../ prior to issuing the command.&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Fri, 25 Aug 2006 11:03:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850027#M7424</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-25T11:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850028#M7425</link>
      <description>what if i want to delete files in current directory and all subfolder within.&lt;BR /&gt;del *.* /s or del /s *.* isn't working &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;it's deleting only files not subfolders. why?</description>
      <pubDate>Fri, 25 Aug 2006 11:11:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850028#M7425</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-25T11:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850029#M7426</link>
      <description>del *.*   &amp;lt;- isn't working... why?&lt;BR /&gt;after that command i have message ...(somenamefiles)\*.*&lt;BR /&gt;what if i want to delete files in current directory and all subfolder within.&lt;BR /&gt;del *.* /s or del /s *.* isn't working &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;it's deleting only files not subfolders. why? i don't want to delete directory that i'm in.</description>
      <pubDate>Fri, 25 Aug 2006 11:18:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850029#M7426</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-25T11:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850030#M7427</link>
      <description>&lt;!--!*#--&gt;Hi kabucek,&lt;BR /&gt;           I have made some changes to the original commands which Jon had given( which I hope Jon does not mind-Jon pls don't sue me for copyright infringement). Now what this does is since u want to delete the sub directories and files the only way to do that is to delete the directory itself. Now your problem was that you want to delete the original folder contents but leave the folder alone but that's not possible with the command RD or RMDIR so what had to be done is delete the folder and create another folder under the same directory with the same name. And so that's what this does --&amp;gt; deletes folder and all subfolders and then creates a folder with the same name  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;@echo off&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: Delete all files within a folder&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;set /P my_folder="Please enter folder to delete files within: "&lt;BR /&gt;&lt;BR /&gt;if exist %my_folder% goto do_dfile&lt;BR /&gt;goto error&lt;BR /&gt;&lt;BR /&gt;:do_dfile&lt;BR /&gt;&lt;BR /&gt;rd /s %my_folder%&lt;BR /&gt;md %my_folder%&lt;BR /&gt;&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;:error&lt;BR /&gt;echo Folder was not found.&lt;BR /&gt;&lt;BR /&gt;:done&lt;BR /&gt;&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: End of delete script&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simple ain't it, now on a very personal note i would like to say that u r asking these questions to your peers so please add a couple of pleases and thank yous in your posts. we ain't your slaves just your ordinary technogeeks(of which i do not consider myself worthy to be part of).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shijo</description>
      <pubDate>Fri, 25 Aug 2006 13:32:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850030#M7427</guid>
      <dc:creator>Shijo</dc:creator>
      <dc:date>2006-08-25T13:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850031#M7428</link>
      <description>another way that you can delete ALL of the directories within a folder, except for the current directory, is to add the following 'FOR' command to the original script file.&lt;BR /&gt;&lt;BR /&gt;cd %my_folder%&lt;BR /&gt;&lt;BR /&gt;del /F *.*&lt;BR /&gt;del /F /AH *.*&lt;BR /&gt;for /f %%i in ('dir /b /ad') do&lt;BR /&gt;  rmdir %my_folder%\%%i&lt;BR /&gt;&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Fri, 25 Aug 2006 14:49:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850031#M7428</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-25T14:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850032#M7429</link>
      <description>&lt;!--!*#--&gt;@Jon&lt;BR /&gt; So you r looping it to find all dir and delete one by one. I haven't checked it out but if it works thats awesome. *bows down* But my way is still better simple yet efficient. Even though the thought occured to me to use a loop I didn't know how to do it. Heck this is the first time I see a 'for' command used as dos command(gotta learn more). But since Kabucek does not want anything to be in the folder I think my option works..just a sweet wam bam thank you mam.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shijo</description>
      <pubDate>Fri, 25 Aug 2006 15:14:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850032#M7429</guid>
      <dc:creator>Shijo</dc:creator>
      <dc:date>2006-08-25T15:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850033#M7430</link>
      <description>what if i don't want to specify directory. just simple write ones the batch file. run it and after that it will delete all files and folder within (include hidden, system, etc.) BUT NOT the bath file!! when it will delete all the files i want to take that batch file to different location and do the same thing.&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Aug 2006 15:19:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850033#M7430</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-25T15:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850034#M7431</link>
      <description>&lt;!--!*#--&gt;@Jon&lt;BR /&gt;&lt;BR /&gt;    Jon the for loop does not work, I think the problem is even though the loop might work the my_folder var still has the name of the intial dir, U need to extract the name of each dir in the loop and put it in var my_folder and I don't know how so some guidance please.&lt;BR /&gt;&lt;BR /&gt;    Kabucek what u r trying to do does not make any sense, why do you want to put it in the directory when u still have to specify the name of the directory anyway. Put the dat file in the root directory and just execute with the name of the folder u wanna nuke.    &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shijo</description>
      <pubDate>Fri, 25 Aug 2006 16:29:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850034#M7431</guid>
      <dc:creator>Shijo</dc:creator>
      <dc:date>2006-08-25T16:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850035#M7432</link>
      <description>Minor change...  either ()'s need to be used, or the command goes on one line like below:&lt;BR /&gt;&lt;BR /&gt;del /F *.*&lt;BR /&gt;del /F /AH *.*&lt;BR /&gt;for /f %%i in ('dir /b /ad') do rmdir %my_folder%\%%i&lt;BR /&gt;&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;**note that it "may" wrap, but the command should be on the same line.&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Fri, 25 Aug 2006 18:57:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850035#M7432</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-25T18:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850036#M7433</link>
      <description>Ok.....  tested and enhanced:&lt;BR /&gt;&lt;BR /&gt;@echo off&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: Delete all files within a folder&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;for /f %%i in ('cd') do set cur_dir=%%i&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;set /P my_folder="Please enter folder to delete files within: "&lt;BR /&gt;&lt;BR /&gt;if exist %my_folder% goto do_dfile&lt;BR /&gt;goto error&lt;BR /&gt;&lt;BR /&gt;:do_dfile&lt;BR /&gt;&lt;BR /&gt;cd %my_folder%&lt;BR /&gt;&lt;BR /&gt;del /F /Q *.* &amp;gt; nul&lt;BR /&gt;del /F /Q /AH *.* &amp;gt; nul&lt;BR /&gt;&lt;BR /&gt;for /f %%i in ('dir /b /ad') do rmdir /S /Q "%my_folder%\%%i" &amp;gt; nul&lt;BR /&gt;&lt;BR /&gt;cd %cur_dir%&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;:error&lt;BR /&gt;echo Folder was not found.&lt;BR /&gt;&lt;BR /&gt;:done&lt;BR /&gt;&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: End of delete script&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Fri, 25 Aug 2006 19:28:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850036#M7433</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-25T19:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850037#M7434</link>
      <description>Thank you very much for all who are involved in that topic. This is very great from yours side to work on that kind of things. I'm very greatfull for your help!! Thank you very much.</description>
      <pubDate>Mon, 28 Aug 2006 10:31:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850037#M7434</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-28T10:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850038#M7435</link>
      <description>Glad to help, and welcome to the forum.&lt;BR /&gt;&lt;BR /&gt;If you'd like to help other members with questions, and you're interesed in earning points, here's how:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Mon, 28 Aug 2006 11:33:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850038#M7435</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-28T11:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850039#M7436</link>
      <description>@echo off&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: Delete all files within a folder&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;for /f %%i in ('cd') do set cur_dir=%%i&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;set /P my_folder="Please enter folder to delete files within: "&lt;BR /&gt;&lt;BR /&gt;if exist %my_folder% goto do_dfile&lt;BR /&gt;goto error&lt;BR /&gt;&lt;BR /&gt;:do_dfile&lt;BR /&gt;&lt;BR /&gt;cd %my_folder%&lt;BR /&gt;&lt;BR /&gt;del /F /Q *.* &amp;gt; nul&lt;BR /&gt;del /F /Q /AH *.* &amp;gt; nul&lt;BR /&gt;&lt;BR /&gt;for /f %%i in ('dir /b /ad') do rmdir /S /Q "%my_folder%\%%i" &amp;gt; nul&lt;BR /&gt;&lt;BR /&gt;cd %cur_dir%&lt;BR /&gt;goto done&lt;BR /&gt;&lt;BR /&gt;:error&lt;BR /&gt;echo Folder was not found.&lt;BR /&gt;&lt;BR /&gt;:done&lt;BR /&gt;&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;rem .: End of delete script&lt;BR /&gt;rem .:-------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;- i've got message:&lt;BR /&gt;The system cannot find specified file.. why?????</description>
      <pubDate>Mon, 28 Aug 2006 13:53:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850039#M7436</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-28T13:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850040#M7437</link>
      <description>ok i know what's wrong but i have question.. hehe again&lt;BR /&gt;&lt;BR /&gt;why it's not deleting new Briefcase file??? any other files are deleted but not that one, why??&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Aug 2006 13:57:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850040#M7437</guid>
      <dc:creator>kabucek</dc:creator>
      <dc:date>2006-08-28T13:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to write a batch file in windows??</title>
      <link>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850041#M7438</link>
      <description>If a file is in use, (in windows) it can't be deleted.  The "My Briefcase" folder is supposted to be a system folder for file transfer (sync'ing of off-line files).&lt;BR /&gt;&lt;BR /&gt;Windows probably believed that it was in use, or was flagged as a system folder so as not to be deleted.&lt;BR /&gt;&lt;BR /&gt;Try running "attrib" on the folder, or view the folder attributes through Windows Explorer.&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Mon, 28 Aug 2006 17:14:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-microsoft/how-to-write-a-batch-file-in-windows/m-p/3850041#M7438</guid>
      <dc:creator>Jon Finley</dc:creator>
      <dc:date>2006-08-28T17:14:09Z</dc:date>
    </item>
  </channel>
</rss>

