Jump to content

Registry Related Problem with AutoIt


JohnWang
 Share

Recommended Posts

Hi

I try to make a program that export and imports Registry, however i encounter some problem and needs help. The Problem is that the registry only allows me to exports to a path containing only the drive and the name Example "C:\Backup.reg" anything else the program does nothing Example of not working path "C:\Program Files\Test.reg". Im not familiar with Dos command runs, and cant find a way to solve the problem .. i checked the path the name of the save file(file name cant not contain space) but still cant figure out why it only takes C:\ as its path. One thing that makes me know that it "may" be possible is that if u run regedit.exe manually it allows u to export to any path u desire. Hope someone can help me out on finding the problem. Thanks in advance

Here is my codes

Func onRegExport()

Local $e_Path

Local $FontSize = 13

MsgBox(0,"Warning","Currently it only talkes the Drive Letter as path Ex. C:\Test.reg")

$e_Path = FileSaveDialog("Please Choose Export Path",@HomeDrive,"All (*.*)|Reg files (*.reg)",18,"RegistryBackup-" & @Mon & "-" & @MDAY & "-" & @Year)

Sleep(500)

if @DesktopWidth <= 1024 Then $FontSize = 10

SplashTextOn("Exporting Registry","TweakUI is now exporting your Registry to " & $e_Path & ".reg Please Wait...",@DesktopWidth/4,@DesktopHeight/10,-1,-1,16,"Aerial",$FontSize,500)

Sleep(100)

runwait(@comspec & " /c " & "REGEDIT /E " & $e_Path & ".reg", "" ,@SW_Hide)

SplashOff()

EndFunc

Link to comment
Share on other sites

Don't know for sure but it may be a quote problem... if you have spaces in the file name it needs to be in quotes and i'm not sure if FileSaveDialog does that or not...

try-

runwait(@comspec & " /c " & "REGEDIT /E " & '"' & $e_Path & '.reg"', "" ,@SW_Hide)

just a shot in the dark...

Edited by evilertoaster
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...