Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:59:31+00:00 2026-06-08T21:59:31+00:00

Here is my current set up. C:\user\Desktop\folder C:\user\Desktop\folder\run.bat Because I wasn’t able to use

  • 0

Here is my current set up.

C:\user\Desktop\folder
C:\user\Desktop\folder\run.bat

Because I wasn’t able to use rmdir to delete the parent folder I tried making a helper.bat file that was added to the Desktop that would ideally delete the folder and delete itself after running. But I guess the process is still running, so it will only delete the contents of folder but not folder itself?

run.bat:

set HELPERFILE=helper.bat
cd %cd%
cd ..
echo echo Deleting the directory...>%HELPERFILE%
echo pause>>%HELPERFILE%
echo rmdir /s /q testfolder>>%HELPERFILE%
echo del %HELPERFILE%>>%HELPERFILE%
echo pause>>%HELPERFILE%
echo exit>>%HELPERFILE%
call "testing" /wait %HELPERFILE%

How can I delete everything after running run.bat including the parent directory it is contained within? I believe it has something to do with call and/or start?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:59:33+00:00Added an answer on June 8, 2026 at 9:59 pm

    The trick is to make sure that your batch file is no longer running and that nothing is in a folder being deleted (that is, nothing has a folder to be deleted as the current directory).

    Given a structure

    Z:\
    Z:\Test
    Z:\Test\Kill
    Z:\Test\Kill\run.bat
    

    the following run.bat will completely remove the Kill folder

    REM Do Stuff
    start rmdir Z:\test\kill /s /q
    

    If you run the batch file from a command window, make sure you are not in the Kill folder, e.g.

    Z:\Test> Kill\run.tab

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is how our current php development solution is set up: Each developer work
Here is my current code in the controller. @rating = (@approvals.count / @user.pages.count) +
Here is my current setup: Database Role - MyDbRole Schema - MySchema User -
First here's my current setup: models/user.rb class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable,
Here's my current situation: I have a NSMutableArray named dictKeyArray which I assign a
Here is the current code in my application: String[] ids = str.split("/"); When profiling
Here is the current code I am using to parse the URL and it's
Here is my current position with a Jquery Banner - http://jsfiddle.net/WcXBs/2/ Apologies for the
Here is my current setup. I have two pages running on the jquery mobile
Here is my current situation; I am a near complete regexp illiterate, and have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.