Avatar of lianne143
lianne143
Flag for United States of America asked on

Batch file to delete a folder in windows 7 , when the PC restarts.

Hi

I want to delete a folder in windows 7 when this PC restarts.The folder is located in the following location .

C$\ProgramData\Microsoft\Windows\Start Menu\Programs\Technology\Textile Technology

I will create a GPO and i will apply this batch file to a GPO (Computer configuration-policies- windows settings-Scripts-shutdown)

Please post me a syntax for a batch file;
 

Any help much appreciated, thanks guys.
Visual Basic ClassicScripting LanguagesWindows 7

Avatar of undefined
Last Comment
David Johnson, CD

8/22/2022 - Mon
angelfyre

Create any file name with the extension .bat

Insert the following line:

rd /s /q C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Technology\Textile Technology


This will remove the directory with the contents, in quiet mode, not asking you for confirmation.
plusone3055

rmdir /s /q "C:\TestingThe BatchFile"
SOLUTION
David Johnson, CD

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
lianne143

ASKER
Thanks David it worked like a Charm , it deleted the Textile Technology folder.

Finally I want to add another line to create a folder called "Food Technology" under the following location and want to copy a shortcut within this  Food Technology folder.

C$\ProgramData\Microsoft\Windows\Start Menu\Programs
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
lianne143

ASKER
Thanks for your help so far.
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
LeeTutor

I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
David Johnson, CD

there is more than enough informatrion: accept qlemo's last comment ID: 40445796 and my comment (assisted) ID: 40438107
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.