Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Добавление всех .REG файлов из папки в реестр

 
Post new topic   Reply to topic    Total Commander Forum Index -> Автоматизация Total Commander printer-friendly view
View previous topic :: View next topic  
Author Message
Andrey_A



Joined: 10 Apr 2009
Posts: 394
Location: Сочи

Post (Separately) Posted: Wed Dec 16, 2009 00:36    Post subject: Добавление всех .REG файлов из папки в реестр Reply with quote

Есть папка, к которой пополняются файлы реестра .REG. Когда их было мало нажимал вручную. Когда стало побольше вносил в батник, но пришла мысль, а как сделать так, чтобы с помощью скрипта или какой-нибудь утилиты все в папке .reg файлы внеслись в реестр без дополнительных запросов
Back to top
View user's profile Send private message
Samwatas



Joined: 12 Sep 2009
Posts: 95

Post (Separately) Posted: Wed Dec 16, 2009 01:02    Post subject: Reply with quote

Всё тем же батником (конструкцией типа "for %%a in (*.reg) do" которая переберет все рег-файлы в папке).
Back to top
View user's profile Send private message
Andrey_A



Joined: 10 Apr 2009
Posts: 394
Location: Сочи

Post (Separately) Posted: Wed Dec 16, 2009 13:20    Post subject: Reply with quote

А можно поподробнее написать полный код

в батник я умею прописывать только это
regedit /s "Files\Reg\Punto_Switcher.reg"
Back to top
View user's profile Send private message
Tol!k



Joined: 01 Apr 2008
Posts: 1727
Location: Арзамас

Post (Separately) Posted: Wed Dec 16, 2009 16:00    Post subject: Reply with quote

Да примерно так (не тестировал) :
Code:
cd /d "D:\Files\Reg"
for %%a in (*.reg) do regedit.exe /s "%%a"


или с помощью forfiles:
Code:
forfiles.exe /P "D:\Files\Reg" /M *.reg /C "regedit.exe /s @file"
Back to top
View user's profile Send private message
Andrey_A



Joined: 10 Apr 2009
Posts: 394
Location: Сочи

Post (Separately) Posted: Wed Dec 16, 2009 22:41    Post subject: Reply with quote

На примере Tol!k я, эксперементируя, в итоге получил кнопку (так как необходимо было прописать путь с переменной). Вот сама кнопка, вроде работает.
Code:
TOTALCMD#BAR#DATA
%COMSPEC% /c
(cd /D %%COMMANDER_PATH%%\Files\Reg\Associations) && (for %%a in (*.reg) do regedit.exe /s "%%a")
wcmicons.dll,79
Регистрация всех .REG файлов в реестре из данной папки


-1

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Автоматизация Total Commander All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group