Reputation: 386
so im having this weird issue with a win 7 pc. I have this application that runs this powershell script from a .bat file. This is the code:
public void GetLastestEarthBackground()
{
var directoryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Scripts");
var vbsFile = Path.Combine(directoryPath, Settings.VBSFileName);
if (File.Exists(vbsFile))
{
var process = new Process
{
StartInfo =
{
WorkingDirectory = directoryPath,
Verb = "runas",
UseShellExecute = true,
FileName = "run.bat", //Settings.VBSFileName,
Arguments = "//B //Nologo"
}
};
process.Start();
process.WaitForExit();
}
}
When i run it from my application i see this in the command line:
But if i double click on the batch file i get this resut:
Any ideas?
Upvotes: 0
Views: 35
Reputation: 21
This seems like a issue with user rights, the program running the script probably does not have the same rights as your user.
Upvotes: 1