Help with NT 4 script

mattingly

Member
Sep 1, 2000
82
0
0
How do I write the command to delete winpopup from the windows directory when students log on to the server? I don't want them to be prompted either.
 

Spiff

Senior member
Oct 10, 1999
439
0
0
Are you looking to remove the chat program? Or are you looking to prevent people from sending net send messages?

to remove Winchat program

@echo off
goto begin

******************************************************
delchat.bat

written 9.20.00
by spiff

This batch file removes the winchat program from the
system. It also removes from the start menu, the
shortcut to the program.
******************************************************

:begin

del c:\winnt\system32\winchat.exe /q /f
del chat.lnk /q /f /s

:end


to remove messaging

@echo off
goto begin

******************************************************
stopmsg.bat

written 9.20.00
by spiff

This batch stops the messenger service when run.
Please note that stopping the messenger service only
prevents the system from receiving messages but does
not prevent it from sending them. This requires
administrative access in order to work. Standard
Users/Domain Users are unable to start or stop
services
******************************************************

:begin

net stop messenger

:end
 

mattingly

Member
Sep 1, 2000
82
0
0
These are windows 98 machines logging into an NT server.
I was told to try
del c:\windows\winpopup.exe |Y
but this doesn't seem to work.
 

Spiff

Senior member
Oct 10, 1999
439
0
0
From your thread title, it appeared as though need a script that would run on NT systems.

I'm confused, is the command asking for confirmation of deletion? There should not be a confirmation request to delete one file, even if it is an executable. A simple del c:\windows\winpopup.exe should be all that is required.

In any case, the syntax used in your example (|Y) is incorrect. To provide an automatic response as you are trying to do, the syntax would be:

echo y | del c:\windows\winpopup.exe

If in fact, Win9x is asking for confirmation to delete the file, then using the switch /q will suppress such confirmation. So your line would then be:

del c:\windows\winpopup.exe /q


One other possibility comes to mind. Is the program starting up when people login? If this is the case, then the program is more than likely in the startup folder(s) on these machines. Therefore, attempting to delete the program will be unsuccessful until the program is shutdown. This is because while the program is active, the file is in use and therefore locked. So in that case, the program would have to be removed from the startup folder as well.

Someone could say that it is being called from the registry, but while that is certainly possible, it highly unlikely.

Provide a little more info if none of this works for you.


to remove Winpopup program

@echo off
goto begin

******************************************************
delpop.bat

written 9.20.00
by spiff

This batch deletes the winpopup program from
the system
******************************************************

:begin

del c:\windows\winpopup.exe /q

:end
 

mattingly

Member
Sep 1, 2000
82
0
0
The script worked but now kids are putting the winpopup.exe in other directories, how would I search the hard drive during the login script for this and delete it?
 

Spiff

Senior member
Oct 10, 1999
439
0
0
to remove Winpopup program

@echo off
goto begin

******************************************************
delpop.bat

written 9.20.00
by spiff

modified 9.29.00

now deletes all instances of winpopup.exe on the
local system

This batch deletes the winpopup program from
the system
******************************************************

:begin

del c:\windows\winpopup.exe /q
del winpopup.exe /s /q

:end


Syntax for del:



<< D:\>del /?
Deletes one or more files.

DEL [/P] [/F] [/S]
>>

[/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/i] >>

[/A[[:]attributes]] names

names Specifies a list of one or more files or directories.
Wildcards may be used to delete multiple files. If a
directory is specified, all files within the directory
will be deleted.

/P Prompts for confirmation before deleting each file.
/F Force deleting of read-only files.
/S Delete specified files from all subdirectories.
/Q Quiet mode, do not ask if ok to delete on global wildcard
/A Selects files to delete based on attributes
attributes R Read-only files S System files
H Hidden files A Files ready for archiving
- Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows
you only the files that are deleted, not the ones it could not find.[/i] >>



Please note, if the systems have more than one partition, then you will need to add a line in there to switch to the additional paritions and remove it there as well...
 

mattingly

Member
Sep 1, 2000
82
0
0
More scripting help. Is there a way to have the windows 98 machines send their computer name to a log file when they log on to the nt servers?
How about a way to search for *.avi or *.mpeg files and put the computer name and file into a log file?