I created a simple wsf script using NotePad. I even saved it in UTF-8
encoding. But the code above fails because the scripting engine cannot
understand the Asian characters.
Error : Unable to save shortcut ".....??????.lnk".
Code 8007007B
Is there any way to create a shortcut in Unicode using WSH? If it is
impossible, please tell me also, then I can start finding another way.
Thank you.
You stated that this is a wsf (and not a vbs) script correct? If so, did
you specify the coding in your opening xml tag? Something like:
<?xml version="1.0" encoding="ISO-8859-1" ?>
On May 6, 10:39 pm, "James Whitlow" <jwhitlow.60372...@bloglines.com>
wrote:
> "Cat" <typing...@gmail.com> wrote in message
Of course, maybe my problem with accessing these files is that the
scripting File System Object isn't showing me the actual characters in
the file names. If the partition were Fat32, I could use my Norton
Utilities to view the sector containing the directory entry for these
files. As far as I know, I don't have a tool that can view NTFS
directory sectors. Does anyone know of a tool, preferably free, that
can display NTFS directory sectors? Perhaps if we can find out what
Unicode file names actually look like on the hard drive then we can
figure out how to create one.
-Paul Randall
"Cat" <typi...@gmail.com> wrote in message
news:3875407d-65b7-4bee...@z24g2000prf.googlegroups.com...
Although you can't create the shortcut with the name you want, you can still
create the shortcut and then rename it. I didn't try using the
Scripting.FileSystemObject, but using cmd.exe's rename command worked fine.
Below is my example; since I'm using one of the Latin ISO sets in news, your
filename may be mangled, but I think you get the picture. I included a brief
wait in the script to ensure that the filename is available before I try the
rename operation; this might not be necessary in practice.
<?xml version="1.0" encoding="UTF-8" ?>
<job id="ShortcutMaker">
<script language="JScript">
<![CDATA[
var WshShell = WScript.CreateObject("WScript.Shell");
var oShellLink = WshShell.CreateShortcut("C:\\This works.lnk");
oShellLink.TargetPath = "C:\\Windows\\Notepad.exe";
oShellLink.IconLocation = "Notepad.exe, 0";
oShellLink.Save();
WScript.Sleep(3000);
WshShell.Run('cmd /c rename "C:\\This works.lnk" 馬鹿な.lnk');
]]>
</script>
</job>
"Cat" <typi...@gmail.com> wrote in message
news:c21c8d96-cc6a-48cc...@w8g2000prd.googlegroups.com...