GPO copy one file to folder programfiles(x86)

Hi Experts,

I need one GPO.
It should copy one file from a share to each computer.
The dest folder may vary a little bit, because it is the program files folder.
And we use x86 and x64 machine.
When I type as dest folder c:\program files (x86)\folder\file.ini then it is not working.

Can you help me out please ?
Eprs_AdminSystem ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Eprs_AdminSystem ArchitectAuthor Commented:
on a x86 system it works.
But how to copy a file to programsfolder on a x64 win system ?
0
Eprs_AdminSystem ArchitectAuthor Commented:
%programfilesx86% is also not working, then the GPO fails...
0
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
It is pretty simple, create a batch file that does something like this:

if exist "c:\program files (x86)\folder" goto 32-bit
xcopy \\servername\sharename\filename.ext "c:\program files\folder\" /c /y
goto end
:32-bit
xcopy \\servername\sharename\filename.ext "c:\program files (x86)\folder\" /c /y
:end


Make the script to run as a logon script.  Copy the file you want in the same location where the GPO puts your batch file.
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Eprs_AdminSystem ArchitectAuthor Commented:
yes this is also a solution ...
0
McKnifeCommented:
No, that batch is not correct. Firstly, he got the architectures mixed up. The ...(x86) is only present on x64, secondly, who assures you that for some silly reason (like this batch file) there wouldn't be an x86 folder on a 32 bit installation as well?
So you should not use "if exist" but instead query the variable %PROCESSOR_ARCHITECTURE%.
if %PROCESSOR_ARCHITECTURE%==AMD64 goto 64bit
But of course scripts are out, anyway. Please make a screenshot of your group policy preference item, there has to be a simple error.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
First of all, good catch, I had the architecture reversed.  Second of all, I have yet to come across a 32-bit system with both program file and program files (x86) folders.  On the contrary I have seen x64 systems with 32-bit applications located under  program files.
0
Eprs_AdminSystem ArchitectAuthor Commented:
solved thanks to all.
0
McKnifeCommented:
Eprs, you will have to close the question somehow. And it would be nice to share what solved the question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.