China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-26 12:09
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » File types in the "New" menu of management → VBS version View 2,114 Replies 14
Original Poster Posted 2007-03-17 06:40 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
①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 ]
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
lxmxn +10 2007-03-17 09:55
Wingl83 +2 2008-10-19 13:15
Attachments
Manage_New.rar (6.79 KiB, Downloads: 157)
未命名.GIF
Floor 2 Posted 2007-03-17 06:55 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Where is the location of the registry?
Floor 3 Posted 2007-03-17 07:01 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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.
Floor 4 Posted 2007-03-17 11:22 ·  中国 四川 成都 电信
初级用户
Credits 105
Posts 44
Joined 2006-10-05 13:57
19-year member
UID 64618
Status Offline
Who knows how to find the "New Briefcase" there?
Floor 5 Posted 2007-03-17 11:25 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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
2.GIF
Floor 6 Posted 2007-04-13 01:38 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
Can you send the original code? The decryption code of slore, I get an error when running it here!!
Floor 7 Posted 2007-04-13 02:21 ·  中国 浙江 杭州 华数宽带
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
Strongly suggest brother baomaboy;
Don't encrypt the source code when releasing things in the future;
Also let us learn something, okay
Floor 8 Posted 2007-04-13 03:05 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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.
Floor 9 Posted 2007-04-13 03:26 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
① 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 ]
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
kich +2 2007-04-13 06:59
Wingl83 +2 2008-10-19 13:34
Floor 10 Posted 2007-04-13 07:00 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 397
Posts 168
Joined 2006-10-08 10:07
19-year member
UID 64934
Status Offline
Thanks, I dug this post up this morning because I think it's still very useful!! Thx
Floor 11 Posted 2007-05-02 16:21 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Originally posted by abczxc at 2007-5-2 11:54:
What script is this


Isn't this an Inputbox?
Floor 12 Posted 2007-05-02 16:22 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Is it not good to separate the part of registering the right - click into a separate VBS?
Floor 13 Posted 2007-05-02 16:40 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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.
Floor 14 Posted 2007-05-02 17:03 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
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.
Floor 15 Posted 2007-05-02 17:38 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Just discovered that originally "laziness" is a common problem. Hehe!
Forum Jump: