仅在文件不存在时运行脚本

时间:2019-01-22 22:58:19

标签: if-statement vbscript

在我的VBScript中,我试图运行另一个VBScript以创建桌面快捷方式 ,该桌面快捷方式不存在。如果桌面链接确实存在,则不应执行任何操作。但是,当前即使存在桌面快捷方式,VBScript仍将运行。为什么?没有语法错误。

namespace WindowsFormsApp1
{
    public class Form1 : Form
    {
        private Button button1;

        public Form1()
        {
            InitializeComponent();
        }
        #region Vom Windows Form-Designer generierter Code
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(349, 155);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "button1";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.ResumeLayout(false);

        }
        #endregion
        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}

0 个答案:

没有答案