Help with fairly simple BAT FILE

March 30, 2010 at 22:17:19
Specs: Windows XP
Hey dudes,

Got a question about a batch file that i want to make. I have a list of remote computers with a particular software package installed that needs to be removed.

I will manually copy this batch file to each PC.

I want the file to run on next startup, remove the program, copy a marker file from my PC to a location (so that anyone looking can see that the bat file has done it's job), then create a text file on my PC with the remote computer's name as the file name (so i know where it's come from)

Here's what i have so far....

cls
@echo off
if exist "\\Remote PC\marker.txt" goto :removed
if not exist "\\Remote PC\marker.txt" goto :notremoved

:removed
echo.Program Alredy Removed
Pause
goto :end

:notremoved
copy "\\my admin pc\temp\marker.txt" "\\Remote PC\">nul
REM the next line removes the software
RUNDLL32.EXE C:\WINDOWS\DOWNLO~1\Program.dll,Uninstall
echo."Program NOT Removed Yet.....but it is now"
Pause
REM i want a text file to be created on "my admin pc\temp\"
REM that has the name "remote pc name.txt" in this bit of the batfile
goto :end

:end


If the marker file already exists, the BAT file has already run, and it stops there.

I want all the text files created on my machine so that i can tell when all the remote machines no longer have the software installed & i can remove the bat file.

So how to i do that bit? Can it be done? Any Clues?


See More: Help with fairly simple BAT FILE

Report •


#1
March 31, 2010 at 05:12:09
@echo off > "my admin pc\temp\Remote PC"


=====================================
Helping others achieve escape felicity

M2


Report •

#2
March 31, 2010 at 07:43:39
@echo off

if not exist "\\Remote PC\marker.txt" goto :notremoved

echo Program Alredy Removed
echo Already run on %computername% >> "\\my admin pc\temp\%computername%.txt"
Pause
goto :EOF

:notremoved
copy "\\my admin pc\temp\marker.txt" "\\Remote PC\" > nul
REM the next line removes the software
RUNDLL32.EXE C:\WINDOWS\DOWNLO~1\Program.dll,Uninstall
echo."Program NOT Removed Yet.....but it is now"
Pause
echo Ran with success on %computername% >> "\\my admin pc\temp\%computername%.txt"
goto :EOF


Report •

#3
March 31, 2010 at 15:52:24
Legends!

Report •
Related Solutions


Ask Question