Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: BATCH saving files to specific locations  (Read 3112 times)

0 Members and 1 Guest are viewing this topic.

legally dead

  • Guest
BATCH saving files to specific locations
« on: February 11, 2009, 01:17:26 AM »
I am a complete novice with batch files. This is what I want to do:

save 3 files to 3 locations for 60 users:

1. Normal.dotm to replace users existing Normal.dotm in C:\Documents and Settings\<user>\Application Data\Microsoft\Templates
2. Save a new *.dotx Word 2007 quick style file to: C:\Documents and Settings\<user>\Application Data\Microsoft\QuickStyles
3. Save\overwrite *.qat file to: C:\Documents and Settings\<user>\Local Settings\Application Data\Microsoft\Office

any help woul be cool
many thanks  :-*

DaveLembke



    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: BATCH saving files to specific locations
« Reply #1 on: February 12, 2009, 12:46:55 PM »
Why do you want to do this?

These files are normally not touched, but are targets for an older style macro virus

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: BATCH saving files to specific locations
« Reply #2 on: February 12, 2009, 01:55:54 PM »
If you have 60 users it would be easier to set up a roaming profile then have all them stored on C: of each PC... unless you have one PC with 60 users which is simply wrong.
I was trying to dereference Null Pointers before it was cool.

GuruGary



    Adviser
    Re: BATCH saving files to specific locations
    « Reply #3 on: February 12, 2009, 03:41:33 PM »
    I assume the 60 users log into a domain controller that has a login script?  And in  #3, I assume "save/overwrite" means "do not back up"?

    Assuming that is the case, you can add something like this to the login script:
    Code: [Select]
    xcopy "path\to\new\Normal.dotm" "C:\Documents and Settings\%username%\Application Data\Microsoft\Templates\" /Y
    xcopy "path\to\new\*.dotx" "C:\Documents and Settings\%username%\Application Data\Microsoft\QuickStyles\" /Y
    xcopy "path\to\new\*.qat" "C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\Office\" /Y

    If you need to be sure it only runs once, then you could add an IF EXIST statement to check for a file to see if it has been run already.