none
logon script for looping - searching - deleting - copy RRS feed

  • General discussion

  • I was trying to do multiple functions within a logon script.  If nobody wants to write the script, can you please point me to the right resource to find how to code it.  I am completely new to this and need help.

    The logic is to have a list of files on the server which were recently updated(this list changes all the time), using these files you would loop and search for these same files on the end user's machine upon logging in.  When it finds that same file on the end user's machine you would delete the file from the end user's machine, then copy the new updated file from the server onto the end user's machine in the same location the previous one was deleted from.  If file not found on end user's machine then just copy new one without deleting anything in highest level directory.  When done, you would loop again until you went thru every file that was updated on the server.  The source directory will always be the same and the copy to directory on end user's machine will always be the same, but end user's machines have subdirectories and the files that will be getting updated are in both.  Any help in any fashion would be appreciated.

    We are in the process of migrating from XP to Windows 7.  While in XP, we only had to do a copy function in the logon script and it would copy over the old file and replace it.  But Windows 7 doesn't delete the old file, it appends the new one to the old one, making it hard for the software looking for these files to work properly when it sees two files instead of one current one.  Hopefully this makes sense, I can elaborate more if anyone wants to help and needs more details.  Thanks.

    Tuesday, October 28, 2014 7:19 PM

All replies

  • I would definitely not recommend copying files to end user machines from a logon script.

    But you are right that this isn't a script-on-demand forum.

    You can post a script request here: https://gallery.technet.microsoft.com/scriptcenter/site/requests

    I would point out that, as with this forum, there is no service-level agreement that guarantees that someone will have the time do this work for you. You will need to provide a very detailed specification; your post here is very vague.

    However: It sounds to me like you don't have a scripting question but some kind of application architecture question.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, October 28, 2014 7:35 PM
    Moderator
  • This was never a problem in XP, the copy function always made sure that the end user would have the most up to date files that the software and its databases needed to perform at optimum level and with the most current tables available.  But in Windows 7, this function doesn't overwrite the file instead it appends the file.  So my logic was to do as stated to loop/search/delete old/ and copy new.  But I have almost no scripting skills so I will have to look for resources that will help with that.  I will try your resource, and hope for the best.  Thanks.
    Tuesday, October 28, 2014 7:44 PM
  • Whether XP or not, it is not recommended to copy files in a logon script.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, October 28, 2014 8:17 PM
    Moderator
  • What is the accepted practice for keeping all the most up to date software updates and database tables from the server to the end users workstations in Windows 7? So I can research it.
    Wednesday, October 29, 2014 1:38 PM
  • That depends on the application. I don't know of any application that requires using a logon script to perform updates for itself. (At least, not any application that is developed with any level of competence.)

    This isn't an application design consulting forum, though.


    -- Bill Stewart [Bill_Stewart]

    Wednesday, October 29, 2014 2:48 PM
    Moderator