-
@aharon-0
איפה אני מכניס את הקישור לקובץ VBS בשורה 3 או 4?Process scriptProc = new Process(); scriptProc.StartInfo.FileName = @"cscript"; scriptProc.StartInfo.WorkingDirectory = @"c:\scripts"; //<---very important scriptProc.StartInfo.Arguments ="//B //Nologo vbscript.vbs"; scriptProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //prevent console window from popping up scriptProc.Start(); scriptProc.WaitForExit(); // <-- Optional if you want program running until your script exit scriptProc.Close
-
Process scriptProc = new Process(); scriptProc.StartInfo.FileName = @"cscript"; scriptProc.StartInfo.WorkingDirectory = @"C:\Users\User\Desktop\Barbar\Privimail"; //<---very important scriptProc.StartInfo.Arguments ="//B //Nologo UpdatePrivimail.vbs"; scriptProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //prevent console window from popping up scriptProc.Start(); scriptProc.WaitForExit(); // <-- Optional if you want program running until your script exit scriptProc.Close
-
@אוריי נסה להריץ אץ הקוד הזה:
if (File.Exists(@"C:\Users\User\Desktop\Barbar\Privimail\UpdatePrivimail.vbs")) { Process scriptProc = new Process(); scriptProc.StartInfo.FileName = @"cscript"; scriptProc.StartInfo.WorkingDirectory = @"C:\Users\User\Desktop\Barbar\Privimail"; //<---very important scriptProc.StartInfo.Arguments ="//B //Nologo UpdatePrivimail.vbs"; scriptProc.StartInfo.CreateNoWindow = false; scriptProc.StartInfo.UseShellExecute = false; scriptProc.Start(); scriptProc.WaitForExit(); // <-- Optional if you want program running until your script exit }else { Console.WriteLine("VBS File not exists.") }
-