Jump to content
Sign in to follow this  
dly

FileInstall cannot install/copy file to system32 folder in Windows 7

Recommended Posts

dly

Hi

I've heard that Windows 7 have restrict on copy file into Windows or System32 folder in Windows 7. I am not sure if it is true but I run FileInstall() successful to other directory but not Windows or System32 folder.

If it is true , does AutoIt has another way around to solve it

Thank you in advance

Share this post


Link to post
Share on other sites
BrewManNH

Yes, don't copy files there. Unless there's an absolute need to do so, then don't do it. I can't think of why you'd need to put files into the Windows folder or System32 that can't be used from practically any other folder.

You could copy them there if you run the script as an administrator, but you'll probably still need to click ok on the UAC prompt if that hasn't been turned off.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
dly

Hi BrewManNH

Sory I didn't make myself clearer.

I have turned off the UAC but still can not copy there. All I need is run the microsoft "netdom.exe" , which is not included in normal Windows setup, for x64 Windows 7 workstation join or unjoin Windows domain. I downloaded from Microsoft website.

As far as I know, for it executable netdom.exe has to be in Windows\System32 . Further more, a file called "netdom.exe.mui" need to be in Windows\System32\en-US folder, otherwise it exit without execute. You can see it returned to command prompt straight away after it run. I have tried copy all in manual create folders and execute from there without success.

I hope someone have similar issue to update Windows or System32 folder in Win7 would help me with some ideal.how to do it

Or maybe any ideal of join / unjoin domain with AutoIt GUI ?

Thanks

Share this post


Link to post
Share on other sites
BrewManNH

You might want to look at this UDF There's a big selection of AD functions included with it that would help with that.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
knaveen

If you are using fileinstall. Install it on a local folder on the PC and then use the normal copy command using the @comspec.

Since you are using x64 edition, check if the ntfsfilesystem redirection is playing up here.

I had this troubleonce, later disabled the NTFSfilesystem redirection just before the copy command and later enabled it. There is a Dll call specific to this, you should be able to find that in the forum somewhere.

Cant remember why i resorted to local file copy instead of using fileinstall directly, i had issues with the NTFSfilesystem redirection had no effect when disabled on File install. It worked on a local copy command!

BTW i use file install and copy on one of my apps in System32 folder, Works like charm across all platforms.

Edited by knaveen

Share this post


Link to post
Share on other sites
Ascend4nt

Windows Vista+ O/S's will not allow any program to write to any part of the Windows or Program Files folders without elevating that program's access rights. This is why you'll notice that all programs that try to write to their own directory or Windows will have the output redirected to "%LOCALAPPDATA%\VirtualStore'. This includes files that write to .INI files or .LOG files (SciTE tools Koda and Obfuscator get their output redirected here).

Changing UAC settings shouldn't affect this feature as far as I know. What is required to write to these folders is program elevation, which can be accomplished in AutoIt scripts in 1 of 2 ways:

1. Add "#RequireAdmin" at the top of the script. This forces the script to restart itself - and will prompt with UAC if it is turned on.

2. Add "#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator" to the top of the script. This will change the manifest resource created when 'compiling' a script, and will get you that fancy UAC shield on the resultant executable.

Note that running anything as administrator can write anywhere on the system. I recommend that UAC be set at LEAST to the 1st notch on Windows 7. Its quite non-intrusive that way, and keeps you and your system safe.

Share this post


Link to post
Share on other sites
Chimaera

Im trying to copy a file into System32 as well and ive tried all sorts and it just isnt working

Im using FileCopy though and i tried FileMove

#RequireAdmin
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator

FileCopy (@ScriptDir & "\includes\robocopy.exe", "C:\Windows\System32\" ,9)

Im doing this to get a specific version of robocopy installed XP026

How do i get it to copy the file and overwrite?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×