Here is the script used. The error we get is (4) ykREAD_ERROR
Code:
var yk = new ActiveXObject("YubiKcom.YubiKeyConfig");
if (!yk.ykIsInserted)
{
WScript.Echo("Please insert the YubiKey before running this script.");
}
else
{
/*
0: ykFLAG_TAB_FIRST
1: ykFLAG_APPEND_TAB1
2: ykFLAG_APPEND_TAB2
3: ykFLAG_APPEND_DELAY1
4: ykFLAG_APPEND_DELAY2
5: ykFLAG_APPEND_CR
6: ykFLAG_SEND_REF
7: ykFLAG_TICKET_FIRST
8: ykFLAG_PACING_10MS
9: ykFLAG_PACING_20MS
10: ykFLAG_ALLOW_HIDTRIG
*/
WScript.Echo("Configuring YubiKey...");
yk.ykStaticID = "42424242";
yk.ykUID = "Brian";
yk.ykKey = "277e34c4f584be8b1d1268d2c70af8c";
yk.ykFlagProperty(5) = true;
// This currently fails on Vista with error code 4.
var result = yk.ykProgram;
if (result == 0)
{
WScript.Echo("Re-configuration successful!");
}
else
{
/* I believe these are:
0: ykOK
1: ykNO_DEVICE
2: ykMORE_THAN_ONE
3: ykREAD_ONLY
4: ykREAD_ERROR
5: ykWRITE_ERROR
*/
WScript.Echo("Error: " + result);
}
}