微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决如何在 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 举报,一经查实,本站将立刻删除。