Sign in to follow this  
Followers 0
LynnS

RegWrite failed when it has an abnormal path

3 posts in this topic

When trying to write an entry into the registry (specifically the Windows Run key) on a Windows XP system, it fails:

$test2 = RegWrite('HKLM\Software\Microsoft\Windows\CurrentVersion\Run', 'FHCServicesPortalUpdate', 'REG_SZ', 'C:\FHC_Tools\new.Portal\new.PortalSvc.exe')
MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$test2' & @lf & @lf & 'Return:' & @lf & $test2) ;### Debug MSGBOX
; fails to write

I have tried various things with no success. If I just change the data string slightly that gets written the code works just fine. For example, this code works:

$test2 = RegWrite('HKLM\Software\Microsoft\Windows\CurrentVersion\Run', 'FHCServicesPortalUpdate', 'REG_SZ', 'C:\FHC_Tools\new.Portal2\new.Portal2Svc.exe')
MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$test2' & @lf & @lf & 'Return:' & @lf & $test2) ;### Debug MSGBOX
; works just fine

Windows 7 (with the #RequireAdmin) has no problems.

I have already checked the Registry permissions and my "administrator" user has Full access.

Any Ideas why it won't work?

Share this post


Link to post
Share on other sites



When trying to write an entry into the registry (specifically the Windows Run key) on a Windows XP system, it fails

Hi,

Can you provide the debug? (error code & return value)

I have tested it on XP and it works fine.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

$return = RegWrite('HKLMSoftwareMicrosoftWindowsCurrentVersionRun', 'FHCServicesPortalUpdate', 'REG_SZ', 'C:FHC_Toolsnew.Portalnew.PortalSvc.exe')
$error = @error

MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$return' & @lf & @lf & 'Return:' & @lf & $return) ;### Debug MSGBOX
MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$error' & @lf & @lf & 'Return:' & @lf & $error) ;### Debug MSGBOX

; $return = 0

; $error = 0

It has to be something with that specific test system. Even when I try to import a reg file manually it fails. I also tried stopping the antivirus and manually importing the reg file... Still the same error:

Registry Editor

Cannot import C:Documents and SettingsAdministratorDesktoprunkey.reg: Not all data was successfully written to the registry. Some keys are open by the system or other processes.

Of course, modifying the registry using regedit works fine. Strange behavior, but not an AutoIt thing.

I appreciate that you ran it on a different system, and helped me narrow it further.

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  
Followers 0