Jump to content

Batch File and Wildcards...headache


Guest

Recommended Posts

im trying to create a batch file that needs to delete two folders in two different directories for ALL the users. user names will vary since this needs to be ran on like a hundred different computers.

i tried googling this to no avail. i just need to use a wild card to delete the files in every user but i cant seem to find one that works.

for reference, im trying to delete from:

C:\Users\*need user wild card here*\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines

and

C:\Users\*same wildcard*\Virtual Machines

Link to comment
Share on other sites

Hehehe I'll look later on its gonna get lots of errors what os

THERE IS NO BUILD LOG!

1998 Chevy Silverado ext cab

Alpine CDA-9887

4 Team Fi 15s

2 Ampere Audio TFE 8.0

2 Ampere Audio 150.4

3 Digital Designs CS6.5 component sets

Dual Mechman 370XP Elite alternators inbound!

8 XS Power d3400

6 XS power d680

Second Skin

Stinger

Tsunami Wiring

Sky High

A Real Voltmeter not a piece of shit stinger.

Link to comment
Share on other sites

You know since its in those directories you may not be able to get them. Can you manually deleyenthem? Uac turned off on all boxes?

THERE IS NO BUILD LOG!

1998 Chevy Silverado ext cab

Alpine CDA-9887

4 Team Fi 15s

2 Ampere Audio TFE 8.0

2 Ampere Audio 150.4

3 Digital Designs CS6.5 component sets

Dual Mechman 370XP Elite alternators inbound!

8 XS Power d3400

6 XS power d680

Second Skin

Stinger

Tsunami Wiring

Sky High

A Real Voltmeter not a piece of shit stinger.

Link to comment
Share on other sites

You know since its in those directories you may not be able to get them. Can you manually deleyenthem? Uac turned off on all boxes?

yeah uac is turned off. we can delete them manually no problem but it would be a pain in the ass to do that hundreds of times for upwards of like 20 users on a computer, you know?

Link to comment
Share on other sites

try to talk to sensai. Hes alot better at scripting than I am.

THERE IS NO BUILD LOG!

1998 Chevy Silverado ext cab

Alpine CDA-9887

4 Team Fi 15s

2 Ampere Audio TFE 8.0

2 Ampere Audio 150.4

3 Digital Designs CS6.5 component sets

Dual Mechman 370XP Elite alternators inbound!

8 XS Power d3400

6 XS power d680

Second Skin

Stinger

Tsunami Wiring

Sky High

A Real Voltmeter not a piece of shit stinger.

Link to comment
Share on other sites

i can make one that deletes the last folder across all users.. so both the "\Virtual Machines" folders will be deleted.. im trying to figure out how to just delete the content inside of it, but no luck

09 Civic EX

KDC-X395

(2) SKAR Audio VVX-12

Skar Audio SK-1500.1

4 cu ft @32 (new box and more port soon)

Firing Forward not sealed off

Stock 80 Amp Alt

Big 3 In 1/0 Knu

2 Runs To The Back 1 Pos 1 Neg In 1/0 Knu

DD-1'd 13.8v drop

Link to comment
Share on other sites

@echo off

for /d %%d in ("%userprofile%\..\*.*") do rd "%%d\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\" /s /q

@echo off

for /d %%d in ("%userprofile%\..\*.*") do rd "%%d\virtual machines\" /s /q

and yes i tried \virtual machines\*.*

but it doesnt work :/ this is the best i could come up with.. ive been looking how to clear out the files and not the folder for two hours.. hope i helped

also please be aware that this is a HOT batch file.. meaning that it will destroy all data on every single user profile (except hidden ones) in the specified folders.

this is a working batch file for your needs, i just wish it didnt delete the final "virtual machines" folder and instead deleted all the files inside.

to get this to work (in case you dont know how) make a new text document and copy and paste the above into it, save it and fix the extension to .bat.

or if you know a faster way to make a .bat file, open the .bat file and edit it and paste the above into it.

this batch file has no pause command so all you will see is a flash on the screen then its done

09 Civic EX

KDC-X395

(2) SKAR Audio VVX-12

Skar Audio SK-1500.1

4 cu ft @32 (new box and more port soon)

Firing Forward not sealed off

Stock 80 Amp Alt

Big 3 In 1/0 Knu

2 Runs To The Back 1 Pos 1 Neg In 1/0 Knu

DD-1'd 13.8v drop

Link to comment
Share on other sites

Create yourself a temporary environment variable in your batch file by including the following line at the start of the batch:

set variable_1=[whatever_you_want]

Then to recall, just use %variable_1%

"Cheap, good or fast. You can only pick two out of three."

"Have money? Love story! No money? I'm sorry."

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Who's Online   2 Members, 0 Anonymous, 529 Guests (See full list)

×
×
  • Create New...