PDA

Показать полную графическую версию : Запуск с другим приложением


Rulezzz2
01-03-2010, 14:54
Каким образом можно открыть *.reg файл с помощью блокнота?

madmasles
01-03-2010, 15:05
Rulezzz2,
У меня так открывает: Run (http://www.autoitscript.com/autoit3/docs/functions/Run.htm)("Notepad.exe " & @ScriptDir (http://www.autoitscript.com/autoit3/docs/macros.htm#@ScriptDir) & "\MyReg.reg")

amel27
02-03-2010, 03:38
ShellExecute("file.reg", "", "C:\TEST", "edit")

madmasles
02-03-2010, 08:20
amel27,
У меня Ваш код не работает (Win XP SP3, AutoIt 3.3.2.0)
Почему?
PS
Вручную блокнотом без проблем открывает.

amel27
02-03-2010, 11:47
madmasles, может у вас изменены настройки по умолчанию?..
у меня в реестре так:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.reg]
@="regfile"

[HKEY_CLASSES_ROOT\.reg\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\regfile]
@="Файл реестра"
"EditFlags"=dword:00100000

[HKEY_CLASSES_ROOT\regfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,72,00,65,00,67,00,65,00,64,00,69,00,74,00,2e,00,65,00,78,00,65,00,\
2c,00,31,00,00,00

[HKEY_CLASSES_ROOT\regfile\shell]

[HKEY_CLASSES_ROOT\regfile\shell\edit]

[HKEY_CLASSES_ROOT\regfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\
00

[HKEY_CLASSES_ROOT\regfile\shell\open]
@="&Слияние"

[HKEY_CLASSES_ROOT\regfile\shell\open\command]
@="regedit.exe \"%1\""

[HKEY_CLASSES_ROOT\regfile\shell\print]

[HKEY_CLASSES_ROOT\regfile\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,2f,00,70,00,20,\
00,25,00,31,00,00,00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.reg]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.reg\OpenWithList]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.reg\OpenWithProgids]
"regfile"=hex(0):


P.S. ассоциации на оффсайте: File associations ...using ftype and assoc - not always working (http://www.autoitscript.com/forum/index.php?showtopic=59721)

madmasles
02-03-2010, 12:07
amel27,
У меня, почему-то, нет этого параметра вообще:[HKEY_CLASSES_ROOT\regfile\shell\edit]

[HKEY_CLASSES_ROOT\regfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\
00, хотя никогда не лазил в реестр.
Добавил в реестр [HKEY_CLASSES_ROOT\regfile\shell\edit\command]..., и все прекрасно открывает Вашим способом. :)




© OSzone.net 2001-2012