/build/static/layout/Breadcrumb_cap_w.png

Can't copy a file to system32 on Windows 7

I have a .DLL file that has to be in the c:\windows\system32 folder on a Windows 7 x64 workstation. I have used Wise Script Editor to create a wrapper package. %SYS32% in Wise gets set to c:\windows\SysWOW64 on a Windows 7 x64 machine. So once copied down I try to move to to c:\windows\system32 and it never copies. I've tried from Witnin Wise and from a .CMD file.

Is this folder protected or something? I can copy it if I Manually do it from a CMD window but I can't do it from a script. What gives?

0 Comments   [ + ] Show comments

Answers (10)

Posted by: Erroneus 12 years ago
5th Degree Black Belt
6
Well you need full admin rights (if UAC is on) to write files to system32, so make sure your script is executed either by the SYSTEM account or similar who has full access.
Posted by: Teitan 12 years ago
Senior Purple Belt
3

All you need to do is to set the Pltaform Property in the Summary Information Stream to x64. This will result in, that the File System Redirection won't set the paths to the 32-bit Windows environment on your x64 machine.

Posted by: piyushnasa 12 years ago
Red Belt
2
Which version of WISE are you using?
You will need to upgrade to WISE 8 MR1 to use the functionality of x64.
The Wise Script which you are using will automatically point it to SysWow64 folder.
Posted by: mhsl808 12 years ago
Fifth Degree Brown Belt
2
Yes, I have full admin rights. And I am using Wise 7.x. I know it defaults too Syswow64 but I created a new variable DROP and it's value is c:\windows\system32. And it still won't copy the .DLL to c:\windows\system32.

I've even written a small .CMD file that does the copy. I put a PAUSE statement into my .CMD file and ran it in "Normal" view so I can see it. Wise kicks off the .CMD file, I see that the file WAS COPIED. But when I look in c:\windows\system32 the .DLL is NOT there.

So the .CMD file says it copied the file yet the .DLL is not in the \system32 folder.

Not sure what else to try?!?!
Posted by: mhsl808 12 years ago
Fifth Degree Brown Belt
2
Ok, this is weird. I added a .CMD file in my Wise script that does a MOVE /Y command. I copy the msvcr100.dll to c:\temp then I MOVE it to c:\widows\system32. My PAUSE statements shows me that the MOVE worked. But.... when I search for the file msvcr100.dll it was moved to C:\Windows\SysWOW64 What The Heck !?!?!?! Why?
Posted by: mhsl808 12 years ago
Fifth Degree Brown Belt
2
Ok..... File Redirect on Windows 7 64bit :-) I now know why I have this issue and it think I have a fix.

Thanks.

Comments:
Posted by: mahendraKumar 12 years ago
Senior Yellow Belt
2
Try to Use SYSNATIVE so that file redirection will occur properly
Posted by: piyushnasa 12 years ago
Red Belt
2

When you run your MSI, it will run in Win 32 shell so it will show you that it is copying it to system32, but in actual, in Win32 shell Syswow64 is the system32 folder and hence it is getting copied to syswow64 folder.

I recommend you to read my article here for better understanding:

http://msiworld.blogspot.com.au/2011/09/creating-msi-for-x64-and-x86-machines.html 

You will need to upgrade your WISE package Studio to use it for 64 bit.

Posted by: Hammer1790 12 years ago
2nd Degree Black Belt
2

By default the System32 directory can only be edited by the group TrustedInstaller. If you are apart of this group you should be able to edit the directory.

Posted by: GabrielNar89 11 years ago
White Belt
1

This is a Windows* OS/file system issue.The cause is
the directory paths in the system is longer than 255 characters (including spaces).You may see the error "Can't copy or delete file.".The fully qualified file
name must be less than 260 characters, and the
directory name must be less than 248 characters,"
under the following circumstances:Opening an assembly with .NET ReflectorExporting source code for an assembly using an add-in such as FileDisassembler,or
FileGenerator.There's a lot of additional softwares
which can fix this problem like Long Path Tool.
http://PathTooDeep.com
Long Path Tool can simplify and probably end your
problems in unlocking, managing and renaming files
that appear to have a long filename.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Link

Related Links

Post

Related Posts

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ