GPO, VBScript, Replace files


Recommended Posts

History:

I have a lot of AutoCAD users. There is a folder that holds the pen styles and plotter configs (pc3 files). Some people are in charge of setting up the configurations of these files. The files must be the same on all CAD pc's. Some users change the configurations on their local pc's. Sometimes this is necessary for a specific job.

Problem:

Every morning I need to have the exact same files on all CAD pc's.

The files are updated by the authorised editors from time to time and need to be distributed.

There are too many pc's to update manually.

There are too many pc's to have the folder redirected to the server.

Permissions are not an option as the user do need to create or edit their files on an "as needed" basis.

Most of the users are not capable / too stubborn to remove "custom" files and replace with authorised ones.

Some users insist on creating their owe files over authorised ones or distributing corrupt ones.

Question:

I would like a VB Script that would clear out all files in a specific folder and copy the authorised ones into that folder every time a user logs on.

ie: user logs on -> folder emptied -> authorised files copied over from server.

I will be applying the script via a GPO specific to the users (ie various departments have differing files)

Link to comment
https://www.neowin.net/forum/topic/278937-gpo-vbscript-replace-files/
Share on other sites

Tried it out and it worked.

I created a .cmd file with the Robocopy command and some extra switched (ie log files). Also I added a pause in the cmd file so that I could see it working while testing. That will be taken out when deploying.

I then created a vbs file that would run the cmd file (I can't VB for s***).

Lastly I assigned a group policy to the OU that executes the VBS at logon.

I tested it with my logon and it worked. Now I think I need to assign permissions on the robocopy for authenticated users or will server allow the VBS and cmd to use the file? Robocopy is only on the server. My account is a member of Domain Admins.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I happen to try it today not knowing about the update and was happily surprised; it is great.
    • Hello, Hardware Support Applications are a special kind of Microsoft Store app and have to go through additional checks and certifications because they can communicate directly with their driver, which means that a vulnerability in one of them could allow an attacker access to kernel space memory through the HSA ←→ device driver interface.  In other words, a BYOVD (bring your won vulnerable driver) attack, but with the HSA being used as an extra step. Remember, the Microsoft Store is strategic to Microsoft's long-term goals: they see it as the means to get the same 30% of every application sale that Apple and Google get through their stores, which is why it has been a fixture of Windows since Windows 8 was introduced in 2012 despite a low adoption rate.  Microsoft cannot afford to have anyone get an app through their store which causes a security issue for their end users.  Even if the app was written by and uploaded to the Microsoft Store by a partner, it is Microsoft's name on the store, and they are the ones that will have reputational/brand damage if they allow something malicious into their store. Regards, Aryeh Goretsky  
    • This is more from my childhood, when nickelodeon just launched and had to license shows to have something to air. Left a big an impact, but probably more emotion positive / childhood thing. Europe got the follow up season's decade's latter with the animation studio that did Air Bender but never licenses for the US. I miss the day's of longer intro's. Nier (PS3) Intro is epic, and was very unexpected.  PS1 Xengears was also epic and an amazing game.  
    • Sayan Sen, do you think one day an image of the Windows Vista desktop or the wallpaper could be used in the primary image of an article? (When I think of CDs and DVDs I think of that release of Windows and of earlier releases; it is the one that debuted IMAPI 2.0 and other features.)
  • Recent Achievements

    • Week One Done
      Ricky Chan earned a badge
      Week One Done
    • Week One Done
      maimutza earned a badge
      Week One Done
    • Week One Done
      abortretryfail earned a badge
      Week One Done
    • First Post
      Mr bot earned a badge
      First Post
    • First Post
      Bkl211 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      484
    2. 2
      +FloatingFatMan
      263
    3. 3
      snowy owl
      240
    4. 4
      ATLien_0
      227
    5. 5
      Edouard
      188
  • Tell a friend

    Love Neowin? Tell a friend!