looking for a small script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sd41
    New Member
    • Jul 2008
    • 1

    looking for a small script

    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
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    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.

    Comment

    • philcorps
      New Member
      • Aug 2008
      • 2

      #3
      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.tx t"

      Attach this script to the user login script section of the group policy you created above.

      Comment

      • jg007
        Contributor
        • Mar 2008
        • 283

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

        Code:
        strfile = "c:\temp.txt"                         ' name of file
        
        Set objFSO = CreateObject("Scripting.FileSystemObject") 
        
         if objFSO.FileExists(strfile) Then
            	objFSO.DeleteFile(strfile)   ' If the temp file is found, delete it
        
         end if
        fairly simple code and you should file plenty of stuff on ' file system object ' & VBS files if you need it

        Comment

        Working...