I am trying to run an uninstall command for several remote computers. Is there a way to run CMD as admin to run a script that uninstalls the driver I need it to?
I was using PSEXEC and i can connect to all the computers but I it won't run the batch file i have to uninstall the driver as admin.
Any help would be great!
You can do this by pressing windows key x and selecting open command prompt as administrator
Related
I wrote this .bat file:
runas /savecred /user:Domain\Username "svn checkout https://<Repository> <DestinationLocalFolder>"
To be able to automate the process of downloading source code, it has to be a . bat and it has to run as a different user than the one that is logged in. I tried it in my Windows 7 Workstation and it works perfect. But after trying it on the server, which also has TortoiseSVN, and all user settings that I checked are the same, it just opens an SVN window and immediately closes it.
I have also tried this with powershell:
powershell "runas /savecred /user:Domain\Username ""svn checkout https://<Repository> <DestinationLocalFolder>"""
Any ideas on why this does not work on the server would be greatly appreciated.
I got it, all I needed to do was running an svn cleanup, because in my debugging I had interrupted a previous checkout process. After running an svn cleanup after interrupting the process, it works perfect.
I am using the following code to setup SQL Server using Power Shell
setup.exe /CONFIGURATONFILE=config.ini
When i run the above script in power shell it opens the command prompt and runs the setup.
Is there a way in power shell that the command prompt that is being opened (which i can see on the screen) gets opened in the background.
As because of this command prompt opening i get an error "Requires an interactive shell" when i run the power shell script remotely.
Does it work if you run Setup.exe with the "Silent" mode (No user-interaction) in addition to the ConfigurationFile? Options are documented here : https://msdn.microsoft.com/en-us/library/ms144259.aspx for reference.
Try specifying /Q or /QS
E.g.
".\setup.exe /Q /ConfigurationFile=$commandlineparam"
I'm try to create a batch file that will, among other things like installing the newest version of our software, first UNINSTALL the old version. I have used "wmic product get name" to find the actual name of the program, and then I have scripted the following code to uninstall the program:
wmic product where "name like 'Borland CaliberRM 10.1'" call uninstall /nointeractive >> C:\users\pbrandvold\Desktop\log.txt
When it's finished, I get this message:
Executing (\\PHIL-BRANDVOLD\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{ED8B0A1F-8E90-478A-82B6-7C885A628257}",Name="Borland CaliberRM 10.1",Version="10.1.0.84")->Uninstall()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
ReturnValue = 1603;
};
I can't think of what is happening - why won't this uninstall? I've also tried using the msi, and running:
msiexec.exe /qn /x "Borland CaliberRM 10.1.msi"
Which doesn't work either.
I had this issue when trying to uninstall and reinstall Web Deploy using wmic via a batch file. It did not help running the batch file with elevated privileges.
The only way I could get it to run correctly was to open a Command Prompt window with elevated privileges and run the batch file through that.
The solution I ended up going with was to turn my batch file into an executable using a Bat to Exe converter. http://www.f2ko.de/en/b2e.php
The issue occurs due to the user's privileged of uninstalling the program.
Just open the command prompt as 'Run as administrator and run your command to uninstall the program.
Example :
open cmd with admin:
run below commands
wmic
product get name
product where name="YOUR_PROGRAM_NAME" call uninstall
I need Jenkins to be able to run batch file on slave locally with parameters. I've tried to use PSExec tool, but it does not run when Jenkins tries to do it (slave: windows 7 x86 OS). xCmd cannot be run locally. Can anybody suggest some tools or some way to do it?
PSExec works for me on Windows 7 x64. Solved.
What I'm trying to do might be simple for veteran programmers. I have two Windows machines: MachineA and MachineB. From MachineA, I want to:
1) ssh into MachineB, run a batch file say C:\parent\test.bat -start
2) delete C:\parent folder
3) Copy C:\parent folder from MachineA to the C drive in MachineB
4) Run C:\parent\test.bat -stop
5) I need to do all the above through a script on MachineA (preferably a Batch Script)
Most of what I've read so far about this uses plink or other software (someone suggested WinSCP).
It would be nice if I could do all this WITHOUT installing any software. Any suggestions??
(I do have msysgit on both machines)
SSH is not supported by windows. You will have to install a utility to run a command on a remote machine
You can find details in this post:
How to execute a dos command on a remote PC?
Your other option is to use Windows Powershell scripts.