can anyone help me with ths error :
I am using the below statement to read the registry for default printer.
var sDefault = ""
var oShell = new ActiveXObject("wscript.Shell");
var sRegVal = 'HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device'
sDefault = oShell.RegRead(sRegVal)
GetDefaultPrinter = sDefault
What would regRead return in case it does not find the registry, I am not able to trap that, instead I am getting a javascript error like unable to read registry key ''HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device'
I am using the below statement to read the registry for default printer.
var sDefault = ""
var oShell = new ActiveXObject("wscript.Shell");
var sRegVal = 'HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device'
sDefault = oShell.RegRead(sRegVal)
GetDefaultPrinter = sDefault
What would regRead return in case it does not find the registry, I am not able to trap that, instead I am getting a javascript error like unable to read registry key ''HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device'