Quick 8.3 filename conversion

Leave a Comment
Quick 8.3 filename conversion

   It has been sometime since I have posted some Windows Tips at this blog. The other day, I was tinkering around with a Windows 95 Virtual Machine, in order to try and install/play a CD copy of Megaman X I found at Goodwill two years ago. Unfortunately, the video game installer and the game itself on the CD were MS-DOS based, and would only accept 8.3 filenames for the installation directory ;_;. Whatever shall we do?!

   As I found in a MSDN forum, you could create a VB script, and then drag n' drop a file from another window on it, or simply cut/paste the original path directory in the script's pop box. Just open up Notepad, paste the following script code, save as .vbs, and chug away!

Set fso=CreateObject("Scripting.FileSystemObject")

' Is object a file or folder?
If fso.FolderExists(WScript.Arguments(0)) Then
'It's a folder
Set objFolder = fso.GetFolder(WScript.Arguments(0))
rtrn = InputBox("Here's your short path:", "SHORT PATH", objFolder.ShortPath)
End If

If fso.FileExists(WScript.Arguments(0)) Then
'It's a file
Set objFile = fso.GetFile(WScript.Arguments(0))
rtrn = InputBox("Here's your short path:", "SHORT PATH", objFile.ShortPath)
End If 

Have fun! (Now to get back and kick some robot butt!)



 

0 comments:

Post a Comment

Please login with either OpenID or a Google Account, and then post your comment. Please be respectful and courteous. NO SPAM ALLOWED!

Copyright EagleSoft Ltd. Powered by Blogger.