在运行VBS文件(启动脚本)时,它没有做任何事情。
以下是带参数的路径 -
Set Wshell = CreateObject("Wscript.Shell")
Platform = "abc"
userID = "bce"
MacroName = "cde"
starttime = "date1"
endtime = "date2"
value1 till value 20 are blank i.e. ""
Macro_Parameters = CHR(34) & Platform & CHR(34) & " " & Chr(34) & UserId & CHR(34) & " " & Chr(34) & MacroName & CHR(34) & " " & Chr(34) & starttime & CHR(34) & " " & Chr(34) & endtime & CHR(34) & " " & Chr(34) & CLAIM_ID & CHR(34) & " " & Chr(34) & VALUE1 & CHR(34) & " " & Chr(34) & VALUE2 & CHR(34) & " " & Chr(34) & VALUE3 & CHR(34) & " " & Chr(34) & VALUE4 & CHR(34) & " " & Chr(34) & VALUE5 & CHR(34) & " " & Chr(34) & VALUE6 & CHR(34) & " " & Chr(34) & VALUE7 & CHR(34) & " " & Chr(34) & VALUE8 & CHR(34) & " " & Chr(34) & VALUE9 & CHR(34) & " " & Chr(34) & VALUE10 & CHR(34) & " " & Chr(34) & VALUE11 & CHR(34) & " " & Chr(34) & VALUE12 & CHR(34) & " " & Chr(34) & VALUE13 & CHR(34) & " " & Chr(34) & VALUE14 & CHR(34) & " " & Chr(34) & VALUE15 & CHR(34) & " " & Chr(34) & VALUE16 & CHR(34) & " " & Chr(34) & VALUE17 & CHR(34) & " " & Chr(34) & VALUE18 & CHR(34) & " " & Chr(34) & VALUE19 & CHR(34) & " " & Chr(34) & VALUE20 & Chr(34)
fileProgram = Chr(34) & "C:\Users\%username%\Logs\Script.vbs" & Chr(34)
filelaunch = fileProgram & " " & Macro_Parameters
On Error Resume Next
returnError = Wshell.Run(filelaunch) '
它有超过20个参数。不确定参数是否限制此脚本运行。
答案 0 :(得分:-1)
问题是%username%解析为%userName%而不是变量。您可以使用它来获取用户名
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var express = require('express');
var bodyParser = require('body-parser');
var server = express();
server.use(passport.initialize());
//server.use(passport.session()); -- For persistent login sessions
server.use(bodyParser.urlencoded({ extended: true }))
然后将其用作
Set oShell = CreateObject("WScript.Shell")
strUserName = oShell.ExpandEnvironmentStrings("%USERNAME%")