Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DirectoryInfo filePathDirectory = new DirectoryInfo(filePath);
- Process a = new Process();
- a.StartInfo.FileName = @"C:WindowsSystem32lpr.exe";
- a.StartInfo.Arguments = "-SServerName.Domain.net -Plp " + """ + filePathDirectory + """;
- a.StartInfo.UseShellExecute = false;
- a.Start();
- a.WaitForExit();
- Dim RPname As String
- RPname = FileName.ToString
- Dim a As New Process
- a.StartInfo.FileName = "C:Windowssystem32lpr.exe"
- a.StartInfo.Arguments = "-SServerName.Domain.net -Plp " & Chr(34) & RPname & Chr(34)
- a.StartInfo.UseShellExecute = False
- a.Start()
- a.WaitForExit()
- try
- {
- DirectoryInfo filePathDirectory = new DirectoryInfo(filePath);
- Process a = new Process();
- a.StartInfo.FileName = @"C:Windowssyswow64lpr.exe"; // ADAPTED to the new path!! worked!
- // use filePathDirectory.FullName!!
- a.StartInfo.Arguments = "-SServerName.Domain.net -Plp " + """ + filePathDirectory.FullName + """;
- // or change it to - found it more readable imo
- a.StartInfo.Arguments = string.Format(
- "-SServerName.Domain.net -Plp "{0}"",
- filePathDirectory.FullName);
- a.StartInfo.UseShellExecute = false;
- a.Start();
- a.WaitForExit();
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
Add Comment
Please, Sign In to add comment