Connecting Tech Pros Worldwide Forums | Help | Site Map

looking for a small script

Newbie
 
Join Date: Jul 2008
Posts: 1
#1: Jul 18 '08
Hello,

I am new to the forum.

I am wondering if anyone can help this.

I 'd like to create a start up script that when the network user login, this script will permanently delete a file (i.e. c:\temp.txt)

So the next time who ever login, this file is gone.

Can anyone help a little bit?



thanks alot.

DW

Stang02GT's Avatar
Moderator
 
Join Date: Jun 2007
Location: USA
Posts: 1,152
#2: Jul 18 '08

re: looking for a small script


have you tried searching the net for this?

There a tons of little scripts out there that do what you are looking for or pretty close to it.
Newbie
 
Join Date: Aug 2008
Posts: 2
#3: Aug 18 '08

re: looking for a small script


This is not very difficult to do. Simply just create a group policy in your active directory domain and assign it to the out your users are in. Then create the following file named "login.cmd". Inside that file should be the following:

Login.cmd
@echo off
del "c:\temp.txt"

Attach this script to the user login script section of the group policy you created above.
Needs Regular Fix
 
Join Date: Mar 2008
Posts: 283
#4: Aug 18 '08

re: looking for a small script


if you don't want to use batch files just enter the code below into a .vbs file

Expand|Select|Wrap|Line Numbers
  1. strfile = "c:\temp.txt"                         ' name of file
  2.  
  3. Set objFSO = CreateObject("Scripting.FileSystemObject") 
  4.  
  5.  if objFSO.FileExists(strfile) Then
  6.         objFSO.DeleteFile(strfile)   ' If the temp file is found, delete it
  7.  
  8.  end if
fairly simple code and you should file plenty of stuff on ' file system object ' & VBS files if you need it
Reply