中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-25 05:54
47,813 topics / 349,918 posts / today 1 new / 48,274 members
DOS批处理 & 脚本技术(批处理室) » File types in the "New" menu of management → VBS version
Printable Version  2,312 / 14
Floor1 baomaboy Posted 2007-03-17 06:40
银牌会员 Posts 554 Credits 1,513
①Delete the garbage in the "New" option of the right - click menu, such as: Briefcase.
②Add new types to the "New" menu, such as: Batch processing, VBS, or others.
③Support batch operations, and can be customized (delete/add) the extensions of batch operations.

Initially, when operating the Office series extensions, since their registry values were not in the regular position, all operations failed. Later, after making some modifications, it can be operated. If there are still any file types (extensions) that cannot be operated, please modify the registry by yourself, and also please inform me, thank you!

The extensions collected for batch operations are as follows:

To be deleted: bmp.wav.ais.fla.bbp.psd.rar.zip.bfc.mp3.doc.xls.mdb.ppt.nit.rgs.x3d.ctm.uga.t3d.loc.kpg.sip.aep.nfs.srg.tpc.tbt.smv.rsnp
To be added: txt.reg.inf.bat.vbs.js.ini
Rem To delete the file types in the New menu, add them to the first line in the above format. Only the format line number needs to be correct and it can be inserted at any position.
Rem To add the file types in the New menu, add them to the second line in the above format. Only the format line number needs to be correct and it can be inserted at any position.
Rem bfc: Windows Briefcase file

[ Last edited by baomaboy on 2007 - 3 - 17 at 06:48 AM ]

Attachments
Manage_New.rar (6.79 KiB)
未命名.GIF (5.87 KiB)
Floor2 vkill Posted 2007-03-17 06:55
金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽
Where is the location of the registry?
Floor3 baomaboy Posted 2007-03-17 07:01
银牌会员 Posts 554 Credits 1,513
Originally posted by vkill at 2007-3-17 06:55:
Where is the location of the registry?


Usually it is:
HKCR\.extension\ShellNew\NullFile

And for Office series, it is:
HKCR\.doc\Word.Document.8\ShellNew\NullFile
And because of different Office versions, Word.Document.8 is also different.
Floor4 chengbiner Posted 2007-03-17 11:22
初级用户 Posts 44 Credits 105
Who knows how to find the "New Briefcase" there?
Floor5 baomaboy Posted 2007-03-17 11:25
银牌会员 Posts 554 Credits 1,513
Originally posted by chengbiner at 2007-3-17 11:22:
Who knows how to have a "New Briefcase" there?


I didn't understand your meaning clearly. I understand that you want the New menu to have New Briefcase,

Add .bfc.

[ Last edited by baomaboy on 2007-3-17 at 11:30 AM ]

Attachments
1.GIF (12.88 KiB)
2.GIF (17.66 KiB)
Floor6 kich Posted 2007-04-13 01:38
中级用户 Posts 168 Credits 397
Can you send the original code? The decryption code of slore, I get an error when running it here!!
Floor7 bjsh Posted 2007-04-13 02:21
银牌会员 Posts 621 Credits 2,000
Strongly suggest brother baomaboy;
Don't encrypt the source code when releasing things in the future;
Also let us learn something, okay
Floor8 baomaboy Posted 2007-04-13 03:05
银牌会员 Posts 554 Credits 1,513
Originally posted by bjsh at 2007-4-13 02:21:
Strongly suggest that brother baomaboy;
Do not encrypt the source code when releasing things in the future;

Also let us learn


This post is from nearly a month ago. The ones posted later are all unencrypted.
Floor9 baomaboy Posted 2007-04-13 03:26
银牌会员 Posts 554 Credits 1,513
① Due to the reason of creating a new VBS template, there will be excessive code (useless code) in the code, and because I am lazy, I didn't delete it. Everyone can make do with it.
② Poor foundation, no good coding habits, I write wherever I think of it, so there may be shortcut codes, but I used very tortuous methods, still because of laziness, I didn't rewrite them.
My purpose is to be able to learn methods and skills and be able to use them. As for beautifying the format, simplifying the code, etc., maybe I will do that when I have time and energy. So I hope everyone don't throw eggs at me ^_^.
Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WinVer = WshSHell.Environment("Process")
Set Args = WScript.Arguments
CloseTime = 5
FileName = WScript.ScriptName
FileFullName = WScript.ScriptFullName
FilePath = FSO.GetParentFolderName(FileFullName)
InsPath = FSO.GetSpecialFolder(1)
InsFullName = FSO.BuildPath(InsPath ,FileName)
LnkPathNT = WshSHell.SpecialFolders(2)
LnkPath9X = WshSHell.SpecialFolders(14)
LnkPathAll = WshSHell.SpecialFolders("SendTo")
OtherFileName="Manage_New.txt"
OtherFilePath=FSO.GetSpecialFolder(1)
TemFileName="Untitled"
TemFilePath=FSO.GetSpecialFolder(2)
Copyright="Linglong Technology"
QQ="QQ:25926183"
Email="Email:fty1995@163.com"
InsTitle="Manage_New"
InsAnswer="Add/Remove New Menu"
RegPath1="HKEY_CLASSES_ROOT\Directory\shell\Manage_New\"
RegValue1="Add/Remove New Menu"
RegForm1="REG_SZ"
RegPath2="HKEY_CLASSES_ROOT\Directory\shell\Manage_New\command\"
RegValue2="wscript.exe "&InsFullName
RegForm2="REG_SZ"
RegPath3="HKEY_CLASSES_ROOT\*\shell\Manage_New\"
RegValue3="Add/Remove New Menu"
RegForm3="REG_SZ"
RegPath4="HKEY_CLASSES_ROOT\*\shell\Manage_New\command\"
RegValue4="wscript.exe "&InsFullName
RegForm4="REG_SZ"
WshSHell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.cpl\Application","control.exe","REG_SZ"
IF FileFullName <> InsFullName then
intAnswer = MsgBox(" Add " & InsAnswer & " to the right-click menu, " & Chr(10) & Chr(10) & " Remove " & InsAnswer & " from the right-click menu. ", vbQuestion + vbYesNoCancel, "Installation - " & InsTitle & " - " & Copyright)
If intAnswer = vbYes Then
WshSHell.RegWrite RegPath1,RegValue1,RegForm1
WshSHell.RegWrite RegPath2,RegValue2,RegForm1
WshSHell.RegWrite RegPath3,RegValue3,RegForm3
WshSHell.RegWrite RegPath4,RegValue4,RegForm4
FSO.GetFile(FileFullName).Copy(InsFullName)
Call Install
WshSHell.popup _
"Add script file: " & chr(10) & InsFullName & chr(10) & chr(10) & _
"Add registry entry: " & chr(10) & chr(34) & RegPath3 & chr(34) & chr(10) & chr(34) & RegPath1 & chr(34) & chr(10) & _
chr(10) & CloseTime & " seconds later this window will close automatically! " & chr(10) & chr(10) & _
chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Installation successful - " & InsTitle & " - " & Copyright, 0 + 64
end if
If intAnswer = vbNo Then
WshSHell.RegDelete RegPath4
WshSHell.RegDelete RegPath3
WshSHell.RegDelete RegPath2
WshSHell.RegDelete RegPath1
FSO.DeleteFile InsFullName
WshSHell.popup _
"Delete script file: " & chr(10) & InsFullName & chr(10) & chr(10) & _
"Delete registry entry: " & chr(10) & chr(34) & RegPath3 & chr(34) & chr(10) & chr(34) & RegPath1 & chr(34) & chr(10) & _
chr(10) & CloseTime & " seconds later this window will close automatically! " & chr(10) & chr(10) & _
chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Uninstallation successful - " & InsTitle & " - " & Copyright, 0 + 64
end if
If intAnswer = vbCancel Then
end if
ELSE
FileExName=Inputbox("1. Add extension to New: (add '.' before extension)" & chr(10) & chr(10) & "2. Remove extension from New: (no '.' just enter extension)" & chr(10) & chr(10) & _
"3. Enter '25926183' to customize default extension" & chr(10) & chr(10) & "or perform add and remove operations on all default extensions. " _
,"Enter extension - " & Copyright & " - QQ:25926183","bmp")
if FileExName=chr(50)&chr(53)&chr(57)&chr(50)&chr(54)&chr(49)&chr(56)&chr(51) Then
intAnswer = MsgBox(" Will delete and add all custom extensions, " & Chr(10) & Chr(10) & " Will open the extension custom file for manual modification and save. ", vbQuestion + vbYesNoCancel, "Installation - " & InsTitle & " - " & Copyright)
If intAnswer = vbYes Then
Set ReadFile = FSO.OpenTextFile(FSO.BuildPath(OtherFilePath ,OtherFileName), 1)
ReadLineTextFile=ReadFile.ReadLine
ReadFile.Close
DelNameStrc=ReadLineTextFile
n=len(DelNameStrc)
temp=0
for Tem = 1 to n
if mid(DelNameStrc,Tem,1)="." then
temp=temp+1
end if
next
for i= 1 to temp+1
ni=InStrRev(DelNameStrc,".",n)
mrname=mid(DelNameStrc,ni+1,n-ni)
FileExName="."&mrname
PiaoYi=WshSHell.RegRead("HKCR\" & FileExName & "\")
WshSHell.RegDelete "HKCR\" & FileExName & "\"&PiaoYi&"\ShellNew\"
WshSHell.RegDelete "HKCR\" & FileExName & "\ShellNew\"
n=ni-1
next
Set ReadFile = FSO.OpenTextFile(FSO.BuildPath(OtherFilePath ,OtherFileName), 1)
ReadFile.SkipLine
ReadLineTextFile=ReadFile.ReadLine
ReadFile.Close
AddNameStrc=ReadLineTextFile
n=len(AddNameStrc)
temp=0
for Tem = 1 to n
if mid(AddNameStrc,Tem,1)="." then
temp=temp+1
end if
next
for i= 1 to temp+1
ni=InStrRev(AddNameStrc,".",n)
mrname=mid(AddNameStrc,ni+1,n-ni)
FileExName="."&mrname
PiaoYi=WshSHell.RegRead("HKCR\" & FileExName & "\")
WshSHell.RegWrite "HKCR\" & FileExName & "\ShellNew\NullFile","","REG_SZ"
WshSHell.RegWrite "HKCR\" & FileExName & "\"&PiaoYi&"\ShellNew\NullFile","","REG_SZ"
n=ni-1
next
WshShell.popup chr(10) &_
"Successfully added/removed file types in the New menu. " & chr(10) & chr(10) & chr(10) & _
"Individual extension ShellNew key drift may not be successful, then open the registry to manually find and modify. " & chr(10) & chr(10) & _
chr(10) & CloseTime & " seconds later this window will close automatically! " & chr(10) & chr(10) & _
chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Add/Remove New Menu File Type - " & InsTitle & " - " & Copyright, 0 + 64
end if
If intAnswer = vbNo Then
WshSHell.Run ("Notepad.exe " & FSO.BuildPath(OtherFilePath ,OtherFileName))
end if
else
If FileExName<>"" Then
if left(FileExName,1)="." then
WshSHell.RegWrite "HKCR\" & FileExName & "\ShellNew\NullFile","","REG_SZ"
PiaoYi=WshSHell.RegRead("HKCR\" & FileExName & "\")
WshSHell.RegWrite "HKCR\" & FileExName & "\"&PiaoYi&"\ShellNew\NullFile","","REG_SZ"
WshShell.popup chr(10) &_
"Successfully added ' " & FileExName & " ' file in the New menu. " & chr(10) & chr(10) & chr(10) & _
"Individual extension ShellNew key drift may not be successful, then open the registry to manually find and modify. " & chr(10) & chr(10) & _
chr(10) & CloseTime & " seconds later this window will close automatically! " & chr(10) & chr(10) & _
chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Add New Menu File Type - " & InsTitle & " - " & Copyright, 0 + 64
else
FileExName="."&FileExName
PiaoYi=WshSHell.RegRead("HKCR\" & FileExName & "\")
WshSHell.RegDelete "HKCR\" & FileExName & "\"&PiaoYi&"\ShellNew\"
WshSHell.RegDelete "HKCR\" & FileExName & "\ShellNew\"
WshShell.popup chr(10) &_
"Successfully removed ' " & FileExName & " ' file from the New menu. " & chr(10) & chr(10) & chr(10) & _
"Individual extension ShellNew key drift may not be successful, then open the registry to manually find and modify. " & chr(10) & chr(10) & _
chr(10) & CloseTime & " seconds later this window will close automatically! " & chr(10) & chr(10) & _
chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Remove New Menu File Type - " & InsTitle & " - " & Copyright, 0 + 64
end if
else
end if
end if
End if
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
Sub Install()
Set NewFile = FSO.CreateTextFile(FSO.BuildPath(OtherFilePath ,OtherFileName), True)
NewFile.WriteLine("bmp.wav.ais.fla.bbp.psd.rar.zip.bfc.mp3.doc.xls.mdb.ppt.nit.rgs.x3d.ctm.uga.t3d.loc.kpg.sip.aep.nfs.srg.tpc.tbt.smv.rsnp")
NewFile.WriteLine("txt.reg.inf.bat.vbs.js.ini")
NewFile.WriteLine("Rem To delete the file type in the New menu, add it to the first line in the above format, only require the format line number to be correct and can be inserted at any position. ")
NewFile.WriteLine("Rem To add the file type in the New menu, add it to the second line in the above format, only require the format line number to be correct and can be inserted at any position. ")
NewFile.WriteLine("Rem bfc: Windows briefcase file")
NewFile.Close
End Sub
 

[ Last edited by baomaboy on 2008-3-25 at 12:54 AM ]
Floor10 kich Posted 2007-04-13 07:00
中级用户 Posts 168 Credits 397
Thanks, I dug this post up this morning because I think it's still very useful!! Thx
Floor11 baomaboy Posted 2007-05-02 16:21
银牌会员 Posts 554 Credits 1,513
Originally posted by abczxc at 2007-5-2 11:54:
What script is this


Isn't this an Inputbox?
Floor12 slore Posted 2007-05-02 16:22
铂金会员 Posts 2,478 Credits 5,212
Is it not good to separate the part of registering the right - click into a separate VBS?
Floor13 baomaboy Posted 2007-05-02 16:40
银牌会员 Posts 554 Credits 1,513
Originally posted by slore at 2007-5-2 16:22:
Isn't it good to use a separate VBS for the part of registering the right-click?

Okay, the structure is more reasonable and streamlined. But I need to modify my template. Hehe, I'm not as good as Brother slore who only gives pointers ("Create a shortcut and assign a hotkey to it...") without posting. Hmm, I need to make changes, and it's not just this one, but all my topic posts. But I won't update the posts; I can only make changes on my own hard drive. Thanks for Brother slore's good suggestion.
Floor14 slore Posted 2007-05-02 17:03
铂金会员 Posts 2,478 Credits 5,212
The idea is the most important, so just click. ... I'm lazy to post code, but I know that usually I don't write it.

And if you give a hint but don't post code, then the method written will not be limited to having multiple ways... That can also be learned.
Floor15 baomaboy Posted 2007-05-02 17:38
银牌会员 Posts 554 Credits 1,513
Just discovered that originally "laziness" is a common problem. Hehe!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023