Computing.Net > Forums > Programming > Batch file to delete profiles

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Batch file to delete profiles

Reply to Message Icon

Original Message
Name: ukithelpdesk
Date: July 16, 2008 at 07:35:06 Pacific
Subject: Batch file to delete profiles
OS: Win
CPU/Ram: x32
Manufacturer/Model: dell
Comment:

I am using this batch file to delete profiles

@echo off
delprof /d:15 /q /i /c:\\COM0006

delprof /d:15 /q /i /c:\\COM0009

delprof /d:15 /q /i /c:\\COM0010

I want to get the name of the computers from a txt/csv file as string so that I can update the csv file and run the batch file to delete profiles automatically


Report Offensive Message For Removal


Response Number 1
Name: Pagey
Date: July 17, 2008 at 03:39:48 Pacific
Reply:

Hi,

You could try using a FOR loop like below.

@echo off
FOR /F %%i IN (Computers.txt) do (

delprof /d:15 /q /i /c:\\%%i
)

%%i is the entry pulled from Computers.txt. Add to Computers.txt as many entires as you like and the script will loop until it has actioned it for every entry in the file.

Is this what you mean?


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home



Results for: Batch file to delete profiles

Batch File To Delete Line
    Summary: also, what if i dont know what i want to delete. example: a random line. i just need a batch file to delete the last or last 2 lines. ...
www.computing.net/answers/programming/batch-file-to-delete-line/15539.html

Batch file to delete files in a dir
    Summary: Hi I am trying to get a batch file to delete files which has dates older than 7 days so far I have @ECHO OFF CLS FOR /R C:\User_share %%FILE IN (*.*) DO ( ECHO starting if IF(0 == (ISDATE %%~zFILE bef...
www.computing.net/answers/programming/batch-file-to-delete-files-in-a-dir/14599.html

batch file to delete
    Summary: I am trying to write a small batch file to delete a type of file (*.ptl) in a directory and all subdirectories, here is what I have: del D:\directoryname\ /S *.ptl however, the return gives me somethi...
www.computing.net/answers/programming/batch-file-to-delete/15614.html








Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History






Data Recovery Software