![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to prepend a filename with a pattern string? Assume I have an unknown filename (in a variable) with a path like D:\myproject\data\myfilename.txt Now I would like to prepend the filename with a string "aaa" so that the new filename looks like D:\myproject\data\aaamyfilename.txt How can I do this inside a VBS script? Ken |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to prepend a filename with a pattern string? "Ken Tucker" <kenny23@xxxxxx> wrote in message news:4a6f6e39$0$32670$9b4e6d93@xxxxxx-online.net... Quote: > Assume I have an unknown filename (in a variable) with a path like > > D:\myproject\data\myfilename.txt > > Now I would like to prepend the filename with a string "aaa" so that > the new filename looks like > > D:\myproject\data\aaamyfilename.txt > > How can I do this inside a VBS script? > > Ken > insert "aaa" at this spot. Alternatively you could use the File System Object like so: sName = "D:\myproject\data\myfilename.txt" Set oFSO = CreateObject("Scripting.FileSystemObject") WScript.echo oFSO.GetParentFolderName(sName) & "\aaa" & oFSO.GetFileName(sName) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| RE: searching for a pattern in a string!! | VB Script | |||
| String pattern | PowerShell | |||
| Capture a string of characters and use as filename. | PowerShell | |||
| problems with $var | select-string -pattern $string -q | PowerShell | |||
| Select-String pattern quirk??? | PowerShell | |||