Jump to content

Registry


Recommended Posts

Is there any dating within the registry? I don't see any dates, but as I believe, any file that is placed on the computer is dated some how. I'm interested in calling files by registry, but it would have to be by time and/or date that entry was made in the registry, but I don't see any dates.

Why? Because I need to call the most recent file that was open from the main app from within my app. I figure the only way I can do it is from within the registry. But there is no "coherent" way that the files are placed within the folder that I could see, so I need to call it by date if it is possible.

Edit:

I see something at the bottom of the registry folder called "MRUList" which apparantly whose order changes every time. ex. One minute it will be "duekdj" next it will be "jkeudd" and the file(data) correspond to which ever letter(name). So I guess another way to do it would be to grab the latest MRUList within my script. But if I do that, will the list of files print out?

Edit:

I went ahead and tried using "MRUList" as the registry to look for, but it returns the letters(name) instead of what entry the letters corresponds to. So now I'm stuck. Is there a way to grab the "MRUList" and have it list the files?

Edited by Champak
Link to comment
Share on other sites

maybe

$var = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\au3", "MRUList")
MsgBox(4096, "Program files in:", $var & "  ", 3)

$split = StringSplit($var, "")

For $x = 1 to $split[0]
    $log = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\au3", $split[$x])
    MsgBox(0, "region - Log", $log & "  ", 3)
Next

******** TESTED OK... my WinXP Home SP2

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I'm having a problem with this. When I don't put in the "for -- next" it works except when there is nothing there to grab. When I do put in the "for -- next", it won't work because the function calling the "log"(msgbox) is not within the loop. It has to be outside the loop. And when that is the case, if there are 10 things I need to grab from the registry, they end up all 10 being the same.

I hope I'm being clear on this.

Link to comment
Share on other sites

  • Moderators

I'm having a problem with this. When I don't put in the "for -- next" it works except when there is nothing there to grab. When I do put in the "for -- next", it won't work because the function calling the "log"(msgbox) is not within the loop. It has to be outside the loop. And when that is the case, if there are 10 things I need to grab from the registry, they end up all 10 being the same.

I hope I'm being clear on this.

Try to seperate them into arrays, because all it's doing is taking the current one and ditching the rest ... Make since? In other words you'll always have the "last" entry, never any of the others in it's current state:

Example:

Wrong way:

$Count = 0
For $i = 1 To 10
    $Count = $i
Next
MsgBox(64, "Example:", $Count) ; Will only = 10oÝ÷ Øz0"ØbL¨»§¶+ZºÚ"µÍÌÍÐÛÝ[H   ÌÎNÉÌÎNÂÜ    ÌÍÚHHHÈL    ÌÍÐÛÝ[H    ÌÍÐÛÝ[ [È ÌÍÚH [È^ÙÐÞ
    ÌÎNÓÛ^^IÌÎNË  ÌÍÐÛÝ[
BÌÍÓXZÙP^HHÝ[ÔÜ]
Ý[Õ[TYÚ
    ÌÍÐÛÝ[JKBÜ    ÌÍÞHHÈXÝ[
    ÌÍÓXZÙP^JHHBÙÐÞ
    ÌÎNÑ^[^IÌÎNË   ÌÎNÓ[X   ÌÎNÈ [È ÌÍÞ  [È ÌÎNÈÙH^HH   ÌÎNÈ [È ÌÍÓXZÙP^VÉÌÍÞJB^

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I've changed it around to work for me, so this is what I have now. It works sort of. I'm getting the digits from 1-5 as the message result instead of the string, which is a file path. Also, I don't see how to translate this into a menu item.

$Count = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\npr", "MRUList")
For $i = 1 To 5
    $Count = $Count & $i & @LF
Next

$MakeArray = StringSplit(StringTrimRight($Count, 1), @LF)

For $x = 2 To 2
$recent1 = GuiCtrlCreateMenuItem ($MakeArray[$x],$recentfilesmenu)
Next
For $x = 3 To 3
$recent2 = GuiCtrlCreateMenuItem ($MakeArray[$x],$recentfilesmenu)
Next
For $x = 4 To 4
$recent3 = GuiCtrlCreateMenuItem ($MakeArray[$x],$recentfilesmenu)
Next


        Case $msg = $recent1
            Run($settings1 & ' ' & $MakeArray[$x])          
        Case $msg = $recent2
            Run($settings1 & ' ' & $MakeArray[$x])  
        Case $msg = $recent3
            Run($settings1 & ' ' & $MakeArray[$x])  
oÝ÷ ØÚ0¶¬Ì!jÒ!iÖÞ~Þ²­Æ¥ÛeyÉ^j·«Â­#§¶ÚqÊ&¦X¬«­¢+Ø(íQ¡¥Ì±½½­Ì½È¥Ð((ÀÌØí9¥±1¥¹¬ÄôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÅÕ½Ðí5IU1¥ÍÐÅÕ½Ðì¤(ÀÌØíÍÁ±¥ÐôMÑÉ¥¹MÁ±¥Ð ÀÌØí9¥±1¥¹¬Ä°ÅÕ½ÐìÅÕ½Ðì¤íÍÁ±¥Ñ̽ѡ5IU1¥ÍÐÉ¥ÍÑÉäͼ ±¥¹¬¥Ìɱ¥¹¥Ù¥Õ±±ä±½Ü(ÀÌØí±½ÄôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÀÌØíÍÁ±¥ÑlÅt¤(ÀÌØí±½ÈôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÀÌØíÍÁ±¥ÑlÉt¤(ÀÌØí±½ÌôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÀÌØíÍÁ±¥ÑlÍt¤((íQ¡¥ÌÁ±Ì¥Ð¥¸Ñ¡µ¹Ô((ÀÌØíɹѥ±Íµ¹ÔôÕ¥
Ñɱ
ÉÑ5¹Ô ÅÕ½ÐíI¹Ð¥±Ì%¸9Õ¹¼ÅÕ½Ðì°ÀÌØí¥±µ¹Ô¤(ÀÌØíɹÐÄôÕ¥
Ñɱ
ÉÑ5¹Õ%Ñ´ ÀÌØí±½Ä°ÀÌØíɹѥ±Íµ¹Ô¤(ÀÌØíɹÐÈôÕ¥
Ñɱ
ÉÑ5¹Õ%Ñ´ ÀÌØí±½È°ÀÌØíɹѥ±Íµ¹Ô¤(ÀÌØíɹÐÌôÕ¥
Ñɱ
ÉÑ5¹Õ%Ñ´ ÀÌØí±½Ì°ÀÌØíɹѥ±Íµ¹Ô¤((íQ¡¥Ì±±Ì¥Ð(($%
ÍÀÌØíµÍôÀÌØíɹÐÄ($$%IÕ¸ ÀÌØíÍÑÑ¥¹ÌĵÀìÌäìÌäìµÀìÀÌØí±½Ä¤$$$($%
ÍÀÌØíµÍôÀÌØíɹÐÈ($$%IÕ¸ ÀÌØíÍÑÑ¥¹ÌĵÀìÌäìÌäìµÀìÀÌØí±½È¤$($%
ÍÀÌØíµÍôÀÌØíɹÐÌ($$%IÕ¸ ÀÌØíÍÑÑ¥¹ÌĵÀìÌäìÌäìµÀìÀÌØí±½Ì¤$

Now, the only problem I hd with my original way is if I set the thing to look for 8 registry entries and there are only 5 I would get an error. That is what I want to fix, prevent the errors...if that is possible.

Thanks.

Edited by Champak
Link to comment
Share on other sites

  • Moderators

I've changed it around to work for me, so this is what I have now. It works sort of. I'm getting the digits from 1-5 as the message result instead of the string, which is a file path. Also, I don't see how to translate this into a menu item.

$Count = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\npr", "MRUList")
For $i = 1 To 5
    $Count = $Count & $i & @LF
Next

$MakeArray = StringSplit(StringTrimRight($Count, 1), @LF)

For $x = 2 To 2
$recent1 = GuiCtrlCreateMenuItem ($MakeArray[$x],$recentfilesmenu)
Next
For $x = 3 To 3
$recent2 = GuiCtrlCreateMenuItem ($MakeArray[$x],$recentfilesmenu)
Next
For $x = 4 To 4
$recent3 = GuiCtrlCreateMenuItem ($MakeArray[$x],$recentfilesmenu)
Next
        Case $msg = $recent1
            Run($settings1 & ' ' & $MakeArray[$x])          
        Case $msg = $recent2
            Run($settings1 & ' ' & $MakeArray[$x])  
        Case $msg = $recent3
            Run($settings1 & ' ' & $MakeArray[$x])  
oÝ÷ ØÚ0¶¬Ì!jÒ!iÖÞ~Þ²­Æ¥ÛeyÉ^j·«Â­#§¶ÚqÊ&¦X¬«­¢+Ø(íQ¡¥Ì±½½­Ì½È¥Ð((ÀÌØí9¥±1¥¹¬ÄôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÅÕ½Ðí5IU1¥ÍÐÅÕ½Ðì¤(ÀÌØíÍÁ±¥ÐôMÑÉ¥¹MÁ±¥Ð ÀÌØí9¥±1¥¹¬Ä°ÅÕ½ÐìÅÕ½Ðì¤íÍÁ±¥Ñ̽ѡ5IU1¥ÍÐÉ¥ÍÑÉäͼ ±¥¹¬¥Ìɱ¥¹¥Ù¥Õ±±ä±½Ü(ÀÌØí±½ÄôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÀÌØíÍÁ±¥ÑlÅt¤(ÀÌØí±½ÈôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÀÌØíÍÁ±¥ÑlÉt¤(ÀÌØí±½ÌôII ÅÕ½Ðí!-e}
UII9Q}UMHÀäÈíM=Q]IÀäÈí5¥É½Í½ÐÀäÈí]¥¹½ÝÌÀäÈí
ÕÉɹÑYÉÍ¥½¸ÀäÈíáÁ±½ÉÈÀäÈí
½µ±ÌÈÀäÈí=Á¹MÙ5ITÀäÈí¹ÁÈÅÕ½Ðì°ÀÌØíÍÁ±¥ÑlÍt¤((íQ¡¥ÌÁ±Ì¥Ð¥¸Ñ¡µ¹Ô((ÀÌØíɹѥ±Íµ¹ÔôÕ¥
Ñɱ
ÉÑ5¹Ô ÅÕ½ÐíI¹Ð¥±Ì%¸9Õ¹¼ÅÕ½Ðì°ÀÌØí¥±µ¹Ô¤(ÀÌØíɹÐÄôÕ¥
Ñɱ
ÉÑ5¹Õ%Ñ´ ÀÌØí±½Ä°ÀÌØíɹѥ±Íµ¹Ô¤(ÀÌØíɹÐÈôÕ¥
Ñɱ
ÉÑ5¹Õ%Ñ´ ÀÌØí±½È°ÀÌØíɹѥ±Íµ¹Ô¤(ÀÌØíɹÐÌôÕ¥
Ñɱ
ÉÑ5¹Õ%Ñ´ ÀÌØí±½Ì°ÀÌØíɹѥ±Íµ¹Ô¤((íQ¡¥Ì±±Ì¥Ð(($%
ÍÀÌØíµÍôÀÌØíɹÐÄ($$%IÕ¸ ÀÌØíÍÑÑ¥¹ÌĵÀìÌäìÌäìµÀìÀÌØí±½Ä¤$$$($%
ÍÀÌØíµÍôÀÌØíɹÐÈ($$%IÕ¸ ÀÌØíÍÑÑ¥¹ÌĵÀìÌäìÌäìµÀìÀÌØí±½È¤$($%
ÍÀÌØíµÍôÀÌØíɹÐÌ($$%IÕ¸ ÀÌØíÍÑÑ¥¹ÌĵÀìÌäìÌäìµÀìÀÌØí±½Ì¤$

Now, the only problem I hd with my original way is if I set the thing to look for 8 registry entries and there are only 5 I would get an error. That is what I want to fix, prevent the errors...if that is possible.

Thanks.

I gave you the answer above... Array.

P.S.

For $something = 2 To 2
;something
Next
Is redundant. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

OK, I see why I was just getting numbers---I wasn't using "RegRead" with the "$makearray".

This is what I've done now:

$Count = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\npr", "MRUList")

$MakeArray = StringSplit($Count, "")
For $x = 1 To Ubound($MakeArray) - 1
    $log1 = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\npr", $MakeArray[$x])
    $recent1 = GuiCtrlCreateMenuItem ($log1,$recentfilesmenu)
Next
oÝ÷ Ø.¶­¶»-ªê-êºe¢[yÆ®±è­Á«­æ­xnéÜÛ©äz{"Ø^éîjwZÊv'gßÛd0«mè^X­Á«¢)à
«­¢+Ù½ÈÀÌØí¤ôÄQ¼Ô(ÀÌØí
½Õ¹ÐôÀÌØí
½Õ¹ÐµÀìÀÌØí¤µÀì1)9áÐoÝ÷ ØÚ0jYmêÞ+-¯+)§iÊè²Ëazg§º0z÷«¶©j»m«r¢ëج­çnÖ§µ«­¢+Ø)½ÈÀÌØíͽµÑ¡¥¹ôÈQ¼È(íͽµÑ¡¥¹)9áoÝ÷ ØzØZ¶+b²·ºwZÙèÂ+[jÈjYr¦ëlæÚrH§¶¬jg©¢È­ÈÁ«"úèØ^"x§»­¶«y«(bv+eG­«b±·jëjÈ­ÉèÂåÊØ^«-z{kÊíéæ¶æ¥*®¢ÙbK*ºHrXØ^¢Ø^®Ç¯z{a¢è!¶²²0¶WÚZ¶è¶§©¥éìN¬Ì!jØ­$²X¤{­Ø^ªê-­çÚ®¢Ö§v«¨¶Z ªê-w+y«"h­z÷«éz¶®¶­sb¢66Rb33c¶×6rÒb33c·&V6VçC¢'Vâb33c·6WGFæw3fײb33²b33²fײb33c¶Æös¢66Rb33c¶×6rÒb33c·&V6VçC ¢'Vâb33c·6WGFæw3fײb33²b33²fײb33c¶Æös"

What do I do now to solve this last problem?

Link to comment
Share on other sites

  • Moderators

You ask for solutions with half/part/no code(s)... I suggest to work up an entire example (as small as possible) of what you want to accomplish so we can easily, without having to write it ourselves, fix or locate the issue (something we can actually run). When you state what you want, that's all well in good, but you leave it in our hands to write the code for you. And I for one, feel although I know how to do a few things, that I don't always understand what your asking for in your / others request, but the code will usually help in digesting what your trying to accomplish.

Ok, rant over :)

Here's a "guess" on what your looking for, or what I think is your problem.

$NFileLink1= RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\npr", "MRUList")
$split = StringSplit($NFileLink1, "");splits off the MRUList registry so each link is readable individually below
Dim $log[UBound($split)] ; since we are trying to get the info from $split use the amount of arrays that were made
For $logcount = 1 To UBound($split) - 1
    $log[$logcount] = RegRead("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\npr", $split[$logcount])
Next

;This places it in the menu
Dim $recent[UBound($split)]; since this is direct relation to $log/$split
$recentfilesmenu = GuiCtrlCreateMenu ("Recent Files In Nuendo",$filemenu)
For $recentcount = 1 To UBound($split) - 1
    $recent[$recentcount] = GuiCtrlCreateMenuItem ($log[$recentcount], $recentfilesmenu)
Next

;This calls it

    For $iCount = 1 To UBound($split) - 1
        If $msg = $recent[$iCount] Then
            Run('"' & $settings1 & ' ' & $log[$iCount] & '"')
        EndIf
    Next
I suck at comments so I hope you understand from the few I made inside the code. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I thank you very much for your help Smoke. I thought I had put everything you would need in post 7...my ignorance made me assume that you wouldn't need the entire script, or more than that. In my thinking, I usually don't want to put the entire script unless it's asked for because it is so long, and I would think it is more trouble searching through the whole thing instead of seeing the main components of the problem. I apologize for the trouble and next time I will do as you request.

Thanks again.

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...