Loading ...
Sorry, an error occurred while loading the content.

Re: [BATCH WORLD] Cannot delete empty folder for some reason

Expand Messages
  • foxidrive
    On Sun, 12 Jul 2009 12:17:29 +0300, Aristos Vasiliou ... %temp% is normally the place rather than %tmp% There may be a permissions issue because it is in the
    Message 1 of 3 , Jul 12, 2009
    • 0 Attachment
      On Sun, 12 Jul 2009 12:17:29 +0300, "Aristos Vasiliou"
      <aristos@...> wrote:

      >I am using this batch file to create another batch file in %tmp% which will delete "C:\webserver"
      >
      >>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO.@ECHO off
      >>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO RD /S /Q "%HOMEDRIVE%\webserver"
      >>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO ECHO Easy Web Server was successfully removed from your computer
      >>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO PAUSE
      >cd /d "%TMP%"
      >"%TMP%.\Uninstall_EasyWebServer.cmd"
      >
      >My problem is that the batch file created in %tmp% cannot delete "C:\webserver" and the error message is "The process cannot access the file because it is being used by another process." Which is weird because C:\webserver is just an empty folder.
      >
      >So I downloaded Process Monitor to see which process is keeping C:\webserver in use and found that no process is keeping that folder in use.
      >
      >Do you see anything in that batch file that could be causing this problem?
      >
      >Thanks


      %temp% is normally the place rather than %tmp%

      There may be a permissions issue because it is in the root of C: but try
      this batch file to see if it works on your PC. It works here in XP.


      @echo off
      md "%HOMEDRIVE%\webserver"
      cd /d "%HOMEDRIVE%\webserver"
      dir
      set file="%TEMP%.\Uninstall_EasyWebServer.cmd"
      > %file% ECHO.@ECHO off
      >> %file% ECHO RD /S /Q "%HOMEDRIVE%\webserver"
      >> %file% ECHO ECHO Easy Web Server was successfully removed from your computer
      >> %file% ECHO PAUSE
      cd /d "%TEMP%"
      dir "Uninstall_EasyWebServer.cmd"
      "Uninstall_EasyWebServer.cmd"
    • Aristos Vasiliou
      As always, you re the best Mic :) Thanks ________________________________ From: batchworld@yahoogroups.com on behalf of foxidrive Sent: Sun 7/12/2009 6:23 PM
      Message 2 of 3 , Jul 12, 2009
      • 0 Attachment
        As always, you're the best Mic :)

        Thanks

        ________________________________

        From: batchworld@yahoogroups.com on behalf of foxidrive
        Sent: Sun 7/12/2009 6:23 PM
        To: batchworld@yahoogroups.com
        Subject: Re: [BATCH WORLD] Cannot delete empty folder for some reason





        On Sun, 12 Jul 2009 12:17:29 +0300, "Aristos Vasiliou"
        <aristos@... <mailto:aristos%40aristos.net> > wrote:

        >I am using this batch file to create another batch file in %tmp% which will delete "C:\webserver"
        >
        >>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO.@ECHO off
        >>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO RD /S /Q "%HOMEDRIVE%\webserver"
        >>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO ECHO Easy Web Server was successfully removed from your computer
        >>>"%TMP%.\Uninstall_EasyWebServer.cmd" ECHO PAUSE
        >cd /d "%TMP%"
        >"%TMP%.\Uninstall_EasyWebServer.cmd"
        >
        >My problem is that the batch file created in %tmp% cannot delete "C:\webserver" and the error message is "The process cannot access the file because it is being used by another process." Which is weird because C:\webserver is just an empty folder.
        >
        >So I downloaded Process Monitor to see which process is keeping C:\webserver in use and found that no process is keeping that folder in use.
        >
        >Do you see anything in that batch file that could be causing this problem?
        >
        >Thanks

        %temp% is normally the place rather than %tmp%

        There may be a permissions issue because it is in the root of C: but try
        this batch file to see if it works on your PC. It works here in XP.

        @echo off
        md "%HOMEDRIVE%\webserver"
        cd /d "%HOMEDRIVE%\webserver"
        dir
        set file="%TEMP%.\Uninstall_EasyWebServer.cmd"
        > %file% ECHO.@ECHO off
        >> %file% ECHO RD /S /Q "%HOMEDRIVE%\webserver"
        >> %file% ECHO ECHO Easy Web Server was successfully removed from your computer
        >> %file% ECHO PAUSE
        cd /d "%TEMP%"
        dir "Uninstall_EasyWebServer.cmd"
        "Uninstall_EasyWebServer.cmd"






        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.