473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Make A Batch File That Deletes Files

anoble1
245 128KB
Hi,

Not sure if many can help but I am in IT, and run in to a certain program error all the time. The fix is deleting 4 files in their PC.

Example:
1.Delete the UCF folder located at C:\Documents and Settings\Username\Documentum
2.Delete the Java folder located at C:\Cache

3.Delete Temp internet Files
4.Delete Cookies

Any suggestions?
Nov 29 '12 #1
5 3406
zmbd
5,501 Expert Mod 4TB
Hello,
Wow, an batch file... I remember when these were the only way to fly in the old DOS-1.0/3.0 days.
But I show my age ;)

Anyway, this is one of a few references available to the old notepad basher: http://www.computerhope.com/batch.htm I go with the tutorial in that batch files are not taught anymore and some (like myself) haven't used one in so long...

There are also other scripting languages and power-shell and the like; however, if as my I.T. does, the corperate types have some of these disabled. However, if you have the correct access rights, these old DOS batch files will work!
Nov 29 '12 #2
anoble1
245 128KB
Nice, couldn't figure out how to do the "Username" thing. Cause everyone's username is different.
Nov 29 '12 #3
zmbd
5,501 Expert Mod 4TB
Oh, I should mention that "edit" more than likely isn't usually included in some if the newer versions of windows so you will have to use something else like notepad... just make sure to save the file with the "bat" extention.
Nov 29 '12 #4
Create a text file, name it and change the extension to .bat

If you open a cmd prompt and type in "help" it will list all the acceptable commands.

use del or erase for files and rmdir for directories.

If you are unsure of the usage of a particular command, at the command prompt, type in the command followed by /? i.e. del /? will give you proper usage of del.

On the .bat file you created earlier, right click and select edit. Enter the commands and switches that you want to run, save it, then run it by double clicking the file.

The user folder can be accessed as %userprofile% so to remove the folder UCF, you would use RMDIR "%userprofile%\documentum\UCF".

I would definitely test this before putting it into production. :-)
Nov 29 '12 #5
zmbd
5,501 Expert Mod 4TB
unrauew:
What information did you provide that was not already provided in my post and in the provided tutorial?

Also %userprofile% although should be a universal environment for the local drive ("C:") is not guaranteed to work at the PC level... In fact, if you type that shortcut into a windows explorer on my work pc you will be taken to the roaming profile folder share on the server - not the "c:\....\username\" on the local pc!
Nov 29 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: SkySea | last post by:
Hi! Any help on this would be appreciated... In an HTML document that lists instructions on installing some software, there's a point where a DOS batch file needs to be run in order to copy...
0
by: KMiller | last post by:
My batch file is attempting to copy two files. The first copy works fine, but the second one does not fire when it executes from the Microsoft installer. Code looks like this: @echo off Rem...
3
by: emman_54 | last post by:
Hi every one, I am trying to run a batch file using my asp.net application. I am using the Process class to run the batch file. When I run my web application, In the task manager, i could see...
26
by: mvdkwong | last post by:
What's the trick to running a batch file from VBA? I'm trying to call it using the Shell function but it's not working for me. If I double-click the batch file or run it from the command line it...
4
by: | last post by:
Hello, I am attempting to convert multiple .wav files to the .flac format via a batch script. I know that this can be done with numerous software implementations automatically for me; however, i am...
3
by: Beagle | last post by:
I have a batch file that I am using to delete older files in a directory. It runs great from Windows 2000 computers. However, I now need it to run from Windows XP and it won't. Will one of you much...
3
by: james121285 | last post by:
I have written a program that will take the max and min of 10 set values. I have to now change my program to allow for these inputs to be entered in by another document, and print the values into...
1
by: cryptotech2000 | last post by:
I am trying to write a batch file to do this basically and i know i dont have it right so if anyone could help me i would appreciate it.. Basically the reason i need to do this is we have an...
2
cori25
by: cori25 | last post by:
I am backing up a file in a batch file but when I run the batch it stops in the middle asking whether the path is a directory or a file? How can I declare that it is a file so that it will not stop...
2
by: animedude123 | last post by:
Hey, I was wondering if anyone knew of a way to have a vb.net app that can load a batch file, and run it inside the vb.net app. Something like, when you open the application, you will see a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.