dly Posted October 8, 2011 Posted October 8, 2011 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
BrewManNH Posted October 8, 2011 Posted October 8, 2011 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 GudeHow 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
dly Posted October 8, 2011 Author Posted October 8, 2011 Hi BrewManNHSory 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 itOr maybe any ideal of join / unjoin domain with AutoIt GUI ? Thanks
BrewManNH Posted October 8, 2011 Posted October 8, 2011 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 GudeHow 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
knaveen Posted October 9, 2011 Posted October 9, 2011 (edited) 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 October 9, 2011 by knaveen
Ascend4nt Posted October 9, 2011 Posted October 9, 2011 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. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
Chimaera Posted February 6, 2012 Posted February 6, 2012 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? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now