1 Replies - 896 Views - Last Post: 05 October 2012 - 06:52 AM Rate Topic: -----

#1 aj_lavaca   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 55
  • Joined: 18-February 11

delete folder and open program

Posted 03 October 2012 - 12:34 PM

I know nothing about VB or batch files, but I figured someone here may know. I am trying to write a simple batch file that will:
1. Delete a folder in a directory, and then
2. Open a program.

I tried doing this one step at a time, but couldn't get step one done. I made a notepad file and saved it as a .bat file, and when I click it a command prompt opens and immediately closes, but it doesn't seem to do what I am wanting to do.

del C:\Program Files (x86)\World of Warcraft\Cache\*.*

That was suppose to clear out all the files in the Cache folder, but it didn't seem to work.
Since I'm asking anyways, what I really want is how do I get this to just delete the entire folder. It is automatically recreated upon opening the World of Warcraft program. After it deletes the folder, it should then execute this:

"C:\Program Files (x86)\World of Warcraft\World of Warcraft Launcher.exe"

I know a little bit of programming, so I don't really want the "answer", I kinda want to figure it out with a little help along the way. Appreciate the help!

This post has been edited by aj_lavaca: 03 October 2012 - 03:16 PM

Is This A Good Question/Topic? 0
  • +

Replies To: delete folder and open program

#2 maj3091   User is offline

  • D.I.C Lover
  • member icon

Reputation: 330
  • View blog
  • Posts: 1,998
  • Joined: 26-March 09

Re: delete folder and open program

Posted 05 October 2012 - 06:52 AM

Have a look at using the RMDIR function in the batch file.

Type RMDIR /? at a command prompt for it's usage.

Also, paths with spaces in them need to be wrapped in double quotes in batch files.

That should give you a starting point

This post has been edited by maj3091: 05 October 2012 - 06:52 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1