如何在 VBScript 自定义操作中禁用 64 位重定向

问题描述

我编写这个 vbscript 是为了授予 // set globals const MARGIN = { top: 10,right: 30,bottom: 30,left: 40 },WIDTH = 460 - MARGIN.left - MARGIN.right,HEIGHT = 400 - MARGIN.top - MARGIN.bottom; // listing params const BAR_WIDTH = 150 const BAR_HEIGHT = 30 // Init Boxplot SVG element var svg = d3.select("#feature_Boxplot") .append("svg") .attr("width",WIDTH + MARGIN.left + MARGIN.right) .attr("height",HEIGHT + MARGIN.top + MARGIN.bottom) .append("g") .attr("transform","translate(" + MARGIN.left + "," + MARGIN.top + ")"); d3.csv("./sample_score_data.csv",function (data) { // get array of unique player names const featureNames = [...new Set(data.map(d => d.player))]; // =============== create listing of player names =============== // uses rect elements,not ul and li const LISTING_HEIGHT = BAR_HEIGHT * featureNames.length * 1.25 const yBarScale = d3.scaleBand().range([LISTING_HEIGHT,0]).domain(featureNames) // Init listing SVG element var svgListing = d3.select("#listing") .append("svg") .attr("width",BAR_WIDTH + MARGIN.left + MARGIN.right) .attr("height",BAR_HEIGHT * featureNames.length * 1.2) .append("g") .attr("transform"," + MARGIN.top + ")"); // draw rectangles svgListing.selectAll(".listingBar") .data(featureNames) .enter().append("rect") .attr("class","listingBar") .attr("width",BAR_WIDTH) .attr("height",BAR_HEIGHT) .attr("y",(featureNames) => (yBarScale(featureNames))) .style("fill","#33A2FF") // add text svgListing.selectAll(".text") .data(featureNames) .enter().append("text") .attr("class","listingLabel") //.attr("x" .attr("y",(featureNames) => (yBarScale(featureNames))) .attr("dy",".75em") .text(featureNames => featureNames); // ========== draw Boxplot for Sarah ========== let BoxplotData = data.filter((el) => (el.player === 'Sarah')); function updateBoxplot(inputBoxplotData,yMaxValue) { // The idea is to call this function whenever a new player name is clicked. let groupNames = [...new Set(data.map(d => d.game))]; // Boxplot horizontal x scale const xScale = d3.scaleBand() .range([0,WIDTH]) .domain(groupNames) .paddingInner(1) .paddingOuter(.5) svg.append("g") .attr("transform","translate(0," + HEIGHT + ")") .call(d3.axisBottom(xScale)); // Boxplot vertical y scale const yScale = d3.scaleLinear().domain([0,yMaxValue]).range([HEIGHT,0]) svg.append("g").call(d3.axisLeft(yScale)); // Add individual points with jitter const jitterWidth = 50 svg.selectAll("indPoints") .data(inputBoxplotData) .enter() .append("circle") .attr("cx",(d) => (xScale(d.game) - jitterWidth / 2 + Math.random() * jitterWidth)) .attr("cy",(d) => (yScale(d.value))) .attr("r",4) .style("fill","white") .attr("stroke","black"); }; const yMaxValue = d3.max(data.map(d => d.value)) * 1.15; updateBoxplot(BoxplotData,yMaxValue); }); 文件LocalService 的完全访问权限

C:\Windows\System32\winevt\Logs

当我将它保存为 .vbs 文件时它会起作用。但是当我将这些代码移动到 InstallShield 自定义操作(创建 vbscript 类型的自定义操作)时,它会尝试设置文件Option Explicit Dim strSystem32Folder,strUser Dim intRunError,objShell,objFSO strSystem32Folder = "C:\Windows\System32\winevt\Logs" Set objShell = CreateObject("Wscript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strSystem32Folder) Then strUser="LocalService" intRunError = objShell.Run("%COMSPEC% /c cacls " & strSystem32Folder & " /t /E /g " & strUser & ":F ",2,True) If intRunError <> 0 Then Wscript.Echo "Error assigning permissions for user LocalService to home folder " & strSystem32Folder End If End If 的权限。

如何在脚本中禁用 64 位重定向

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)