gigapixels Veteran Posted October 9, 2003 Veteran Share Posted October 9, 2003 Thank you soooo much. I didn't even know about that wscript.exe... This helps a lot. Thanks again :D Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1236814 Share on other sites More sharing options...
kagaku Posted October 9, 2003 Share Posted October 9, 2003 Would you be so kind as to post the New Folder and New Text File vbs scripts as well? :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1237232 Share on other sites More sharing options...
cydine Posted October 9, 2003 Share Posted October 9, 2003 Here ya go. For these to work, you'll need to have XP or download the latest version of Windows Scripting Host from Microsoft - think it's v5.6. 'NewFolder.vbs Option Explicit Dim fso, ws, objArgs, Title Set fso = CreateObject("Scripting.FileSystemObject") Set ws = CreateObject("Wscript.Shell") Set objArgs = WScript.Arguments Title = "Create New Folder" Call MakeNewFolder Call Cleanup Sub MakeNewFolder Dim strArg, FolderTemp, FolderPath, NewFldr For Each strArg in objArgs FolderTemp = FolderTemp & " " & strArg Next FolderPath = Trim(FolderTemp) NewFldr = InputBox("Name for New Folder?", Title, "New Folder") If NewFldr = "" Then Call Cleanup On Error Resume Next fso.CreateFolder FolderPath & NewFldr If Err.Number = 58 Then Err.Clear:On Error GoTo 0 ws.Popup Chr(34) & NewFldr & Chr(34) & " already exists.", ,Title, 0 + 48 + 4096 Call MakeNewFolder ElseIf Err.Number = 52 Then Err.Clear:On Error GoTo 0 ws.Popup Chr(34) & NewFldr & Chr(34) & " contains invalid character(s).", ,Title, 0 + 48 + 4096 Call MakeNewFolder End If End Sub Sub Cleanup Set ws = Nothing Set fso = Nothing WScript.Quit End Sub 'NewTextDoc.vbs Option Explicit Dim fso, ws, objArgs, Title Set fso = CreateObject("Scripting.FileSystemObject") Set ws = CreateObject("Wscript.Shell") Set objArgs = WScript.Arguments Title = "Create New Text Document" Call MakeNewDoc Call Cleanup Sub MakeNewDoc Dim strArg, FolderTemp, FolderPath, NewDoc For Each strArg in objArgs FolderTemp = FolderTemp & " " & strArg Next FolderPath = Trim(FolderTemp) NewDoc = InputBox("Name for New Document?", Title, "New Text Document") If NewDoc = "" Then Call Cleanup On Error Resume Next fso.CreateTextFile FolderPath & NewDoc & ".txt", False If Err.Number = 58 Then Err.Clear:On Error GoTo 0 ws.Popup Chr(34) & NewDoc & Chr(34) & " already exists.", ,Title, 0 + 48 + 4096 Call MakeNewDoc ElseIf Err.Number = 52 Then Err.Clear:On Error GoTo 0 ws.Popup Chr(34) & NewDoc & Chr(34) & " contains invalid character(s).", ,Title, 0 + 48 + 4096 Call MakeNewDoc End If End Sub Sub Cleanup Set ws = Nothing Set fso = Nothing WScript.Quit End Sub Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1237278 Share on other sites More sharing options...
kagaku Posted October 9, 2003 Share Posted October 9, 2003 Arigatou gozaimasu :D Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1237317 Share on other sites More sharing options...
kagaku Posted October 9, 2003 Share Posted October 9, 2003 (edited) Is there anyway to make it act like the default New Folder/New Text Document menu items do? By that, I mean just have 'em make the folder/file with a default name, and not pop up a dialog like it currently does. I've played with the vbs source a bit, but so far everything I do breaks the script. :D Edit: Alright, I got it to make a directory/text file without asking for a name, but if it already exists the script goes into an infinite loop. Is it possible to do something like.. if 'NewFoldr' exists NewFoldr = "New Folder (2)" Same thing with the New Text Document script. Edited October 9, 2003 by RaGe- Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1237338 Share on other sites More sharing options...
BroChaos Veteran Posted October 9, 2003 Veteran Share Posted October 9, 2003 woohoo, hopefully i can get it to work now. thanks man :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1238508 Share on other sites More sharing options...
cydine Posted October 9, 2003 Share Posted October 9, 2003 RaGe- Something like this you mean? 'NewFolder.vbs 'Version 1.1 for RaGe- Option Explicit Dim fso, ws, objArgs, Count Set fso = CreateObject("Scripting.FileSystemObject") Set ws = CreateObject("Wscript.Shell") Set objArgs = WScript.Arguments Count = 0 Call MakeNewFolder Call Cleanup Sub MakeNewFolder Dim strArg, FolderTemp, FolderPath, NewFldr For Each strArg in objArgs FolderTemp = FolderTemp & " " & strArg Next FolderPath = Trim(FolderTemp) If Count = 0 Then NewFldr = "New Folder" Else NewFldr = "New Folder (" & Count & ")" End If On Error Resume Next fso.CreateFolder FolderPath & NewFldr If Err.Number = 58 Then Err.Clear:On Error GoTo 0 Count = Count + 1 Call MakeNewFolder End If End Sub Sub Cleanup Set ws = Nothing Set fso = Nothing WScript.Quit End Sub ? 'NewTextDoc.vbs 'Version 1.1 for RaGe- Option Explicit Dim fso, ws, objArgs, Count Set fso = CreateObject("Scripting.FileSystemObject") Set ws = CreateObject("Wscript.Shell") Set objArgs = WScript.Arguments Count = 0 Call MakeNewDoc Call Cleanup Sub MakeNewDoc Dim strArg, FolderTemp, FolderPath, NewDoc For Each strArg in objArgs FolderTemp = FolderTemp & " " & strArg Next FolderPath = Trim(FolderTemp) If Count = 0 Then NewDoc = "New Text Document" Else NewDoc = "New Text Document (" ?& Count & ")" End If On Error Resume Next fso.CreateTextFile FolderPath & NewDoc & ".txt", False If Err.Number = 58 Then Err.Clear:On Error GoTo 0 Count = Count + 1 Call MakeNewDoc End If End Sub Sub Cleanup Set ws = Nothing Set fso = Nothing WScript.Quit End Sub ? BTW, please note that I'm not exactly a vbscript guru. It took me about a month to get these scripts working in the first place so no really difficult questions pleas:D :D Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1238579 Share on other sites More sharing options...
BroChaos Veteran Posted October 9, 2003 Veteran Share Posted October 9, 2003 wow, thank you. i got the show hidden files thingy working. i coulda used this years ago! thanks again. i love you :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1238737 Share on other sites More sharing options...
Miran Posted October 9, 2003 Author Share Posted October 9, 2003 Ya that's awesome! Exactly what I was looking for, Thankyou! Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1238814 Share on other sites More sharing options...
cydine Posted October 9, 2003 Share Posted October 9, 2003 Hey no probs. Do you want me to write one for the 'Show File Ext' thing you mentioned at the start of this thread? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1238833 Share on other sites More sharing options...
cydine Posted October 9, 2003 Share Posted October 9, 2003 Did it anyway :D 'Begin code for FileExtXP.vbs 'Version: 1.0 - Windows XP (October 9, 2003) Option Explicit Dim WSHShell, RegKey, FileExt Set WSHShell = CreateObject("WScript.Shell") RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\" FileExt = WSHShell.RegRead (RegKey & "HideFileExt") If FileExt = 1 Then ? 'File extensions hidden ? ? ?WSHShell.RegWrite RegKey & "HideFileExt", 0, "REG_DWORD" ? 'Show file extensions Else ? ? ?WSHShell.RegWrite RegKey & "HideFileExt", 1, "REG_DWORD" ? 'Hide file extensions End If WSHShell.SendKeys "+{F10}e" ? 'Refresh Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1238883 Share on other sites More sharing options...
cydine Posted October 9, 2003 Share Posted October 9, 2003 Anyone got any ideas for other useful vbcripts? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1239454 Share on other sites More sharing options...
gigapixels Veteran Posted October 10, 2003 Veteran Share Posted October 10, 2003 Actually, I have a bit of a question... Neither the New Text Doc nor the New Folder scripts work. I can double-click them in the folder I hold them in and they do what they're supposed to, but when I use the context menu they don't work... Any suggestions? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1239951 Share on other sites More sharing options...
gflores Posted October 10, 2003 Share Posted October 10, 2003 (edited) First of all, I have to say, THANK YOU!!! These vbs scripts are awesome and very useful, especially the show file extensions and show/hide folders.. I've seen the New Folder option in other tweak progs. Just one thing, however. I can't seem to get the New folder vbs to work. Well, actually, it does work but it creates the new folder in Documents and Settings\Gabe Flores directory instead of the directory i'm currently in. Any suggestions? Thanks again! ps: do you know of a way to remove a bunch of junk from the context menu, such as "move to folder" and "customize this folder" and the Windows Media Player context menu, among other things? Thanks. Edited October 10, 2003 by gflores Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1240329 Share on other sites More sharing options...
gigapixels Veteran Posted October 10, 2003 Veteran Share Posted October 10, 2003 Ah yes that's what's happening with me. I just checked my Documents and Settings folder and there they were... So yeah, any suggestions? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1240453 Share on other sites More sharing options...
cydine Posted October 10, 2003 Share Posted October 10, 2003 Try putting a %1 in the parameters. For example: Application: C:\WINDOWS\system32\wscript.exe Parameters: D:\System\Tweaks\XP\NewFolder.vbs %1 Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1240773 Share on other sites More sharing options...
gigapixels Veteran Posted October 10, 2003 Veteran Share Posted October 10, 2003 w00t that worked! Thanks cydine, you've made my computer even better :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1241581 Share on other sites More sharing options...
nwBen Posted October 10, 2003 Share Posted October 10, 2003 grr.. i cant get that hide/show files script to work :pinch: Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1241742 Share on other sites More sharing options...
cydine Posted October 10, 2003 Share Posted October 10, 2003 do you know of a way to remove a bunch of junk from the context menu, such as "move to folder" and "customize this folder" and the Windows Media Player context menu, among other things? Thanks. Download a program called X-Setup. This will let you remove a bunch of stuff from your context menus. As far as I can remember, to remove the WMP context menu options you have to unregister a dll. Try typing regsvr32 /u wmpshell.dll in the run box. If you need any more help just let me know :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1241743 Share on other sites More sharing options...
cydine Posted October 10, 2003 Share Posted October 10, 2003 grr.. i cant get that hide/show files script to work :pinch: What's the problem exactly? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1241749 Share on other sites More sharing options...
nwBen Posted October 10, 2003 Share Posted October 10, 2003 i do everything as was explained, but they dont appear in the menu Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1241766 Share on other sites More sharing options...
cydine Posted October 10, 2003 Share Posted October 10, 2003 Can you post a screenshot of your Fast Explorer window so I can check your settings? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1241819 Share on other sites More sharing options...
gflores Posted October 10, 2003 Share Posted October 10, 2003 cool, it worked for me and the WMP shell removal worked great too. Thanks a lot. Downloading x-setup as I speak... errr type. Just wondering, are there any other tips or tweaks or configurations you would like to share. :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1242147 Share on other sites More sharing options...
nwBen Posted October 11, 2003 Share Posted October 11, 2003 OK, here it is b4 I apply the settings.. is it correct? Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1244132 Share on other sites More sharing options...
Oblivion Posted October 11, 2003 Share Posted October 11, 2003 very nice, i'll try it as well :) Link to comment https://www.neowin.net/forum/topic/98584-does-this-program-exist/page/2/#findComment-1244351 Share on other sites More sharing options...
Recommended Posts