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?
 
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
 
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
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
 
Eprs_AdminSystem ArchitectAuthor Commented:
yes this is also a solution ...
0
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.