Vbscript VBS-将机器名称放入olink.targetpath的一部分

Vbscript VBS-将机器名称放入olink.targetpath的一部分,vbscript,Vbscript,所以,这就是我要做的。我们正在推出一个基本的计时解决方案,让员工通过流动办公表单打卡。为了简化事情,我想自动创建快捷方式。我已经成功地传递了机器的IP,现在我需要将机器的名称传递到URL的第一部分 这能做到吗?我需要将“MACHINENAME”替换为实际的机器名,dim ed为CompName 'This script will grab the local active netowork adapter IP, host name, and and creates the time keep

所以,这就是我要做的。我们正在推出一个基本的计时解决方案,让员工通过流动办公表单打卡。为了简化事情,我想自动创建快捷方式。我已经成功地传递了机器的IP,现在我需要将机器的名称传递到URL的第一部分

这能做到吗?我需要将“MACHINENAME”替换为实际的机器名,dim ed为CompName

'This script will grab the local active netowork adapter IP, host name, and  and creates the time keeping shortcut, using the machines IP address. 
'This script will take the local machine name and ammed it to the URL for the cash registers. 

dim NIC1, Nic, StrIP, CompName

Set NIC1 = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")

For Each Nic in NIC1

    if Nic.IPEnabled then

        StrIP = Nic.IPAddress(i)

        Set WshNetwork = WScript.CreateObject("WScript.Network")

        CompName= WshNetwork.Computername

        Set oWS = WScript.CreateObject("WScript.Shell")
        sLinkFile = "C:\Users\public\desktop\Clock in & Out.LNK"
        Set oLink = oWS.CreateShortcut(sLinkFile)
        oLink.TargetPath = "http://MACHINENAME:8080/lfserver/timecard?ip_address=" &StrIP
        oLink.Description = "Clock in or out"   
        oLink.IconLocation = "%SystemRoot%\system32\SHELL32.dll, 111"
        oLink.Save

        wscript.quit

    end if

next

这就是你想要的吗。是否将计算机名添加到http路径

 oLink.TargetPath = "http://" & CompName & ":8080/lfserver/timecard?ip_address=" & StrIP

是的!谢谢就是这样。我没有添加第二个&符号。所以这是在欺骗我。我知道一定有办法,只是不知道怎么做!