![]() With the modified VBS above Ive run it and i get the following. I have Files in a given folder that has Names in them. ![]() SName = Replace(fil.Name, "The ", "") & ", The" I tried something simular.but modified your VBS. 586 flow control DOS batch files, 539 VBScript scripts, 494499 focus. If you like this code, feel free to use it and if you like to spread it on the net, please gimme a link to this page. 5, 43 extensions (show/hide), 557 filename completion in Command Prompt. Feel free to bookmark or subscribe this blog to automatically get updates on this blog. 397 Insert Discussion About the Presentation, 397 Show / Hide Discussion Pane. I'll post the other ways to run this kind of scripts later. VBScript, scripting support, 366 video, 668-669 videoconferencing. When the script is done, it will prompt you with a message box which says 'Completed!'. If object is omitted, the UserForm with the focus is assumed to be object. ![]() vbs file to the folder you want the task to be done and then double click the. The object placeholder represents an object expression that evaluates to an object in the Applies To list. To use the script, you just need to copy this scripts to a text file and then name the textfile with 'rmus.vbs' or any other name you like with '.vbs' extension which is for vbscript. ' check if the file name contains underscore Set fso = WScript.CreateObject("Scripting.FileSystemObject") ' VBScript to replace underscore in file name with space So, I would like to share my VBScript to replace underscores in filename with spaces for all files within a folder. I have this script saved in 'test.vbs': Set FSO CreateObject ('Scripting.FileSystemObject') Set File FSO.OpenTextFile (workFolder &'test.txt', 2, True) File.Write 'testing' File.Close Set File Nothing Set FSO Nothing Set workFolder Nothing When I run the script I want to pass the value of the 'workFolder' variable. I think this VBScript maybe useful for you too. So, as a damn lazy coder, I've wrote a short Visual Basic Script to automatically do the task with only one simple command. But for a collections of files in a folder, this may be a boring repetitive task that I'll hate to do. I know this maybe so simple because you can just select the file in Windows Explorer, Press F2 and manually rename the file. I often have this kind of files when I download mp3s on the internet. For example I would like to see the filename as 'Sharifah Aini - Suasana Hari Raya.mp3' instead of 'Sharifah_Aini_-_Suasana_Hari_Raya.mp3'. ![]() Sometimes I wanted to remove underscores in file name and replace it with space. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |