Re: Can't create shortcut whose name contains Unicode?



Thanks for the reply but it didn't help.
<?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:\\馬鹿な.lnk");
//var oShellLink = WshShell.CreateShortcut("C:\\This works.lnk");
oShellLink.TargetPath = "C:\\Windows\\Notepad.exe";
oShellLink.IconLocation = "Notepad.exe, 0";
oShellLink.Save();
]]>
</script>
</job>

On May 6, 10:39 pm, "James Whitlow" <jwhitlow.60372...@xxxxxxxxxxxxx>
wrote:
"Cat" <typing...@xxxxxxxxx> wrote in message

news:c21c8d96-cc6a-48cc-a6c5-a1591f7c11d5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

var oShellLink = WshShell.CreateShortcut( path+ "\\Some Asian
characters.lnk");
...
ShellLink.Save();

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.

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" ?>

.


Loading