Require command to create subfolder(Extensions) at c:\Program Files\Mozilla Firefox\Extensions adding admin ID and password - firefox-addon-webextensions

Require command to create subfolder(Extensions) at c:\Program Files\Mozilla Firefox\Extensions adding admin ID and password
I am trying to create subfolder in to c:\Program Files\Mozilla Firefox\ and want to copy .xpi file in to it using admin credentials

Related

Create Batch file to run mstest for coded ui test automation

Can someone help me out in creating Batch file to run the coded ui test using mstest?
I am currently running the coded ui test in the command prompt by running as administrator by using below lines in command prompt:
cd\
cd C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE>MSTest.exe /testcontainer:D:\Working\LOPS_Testing\LOPS6Automation\bin\LOPS6Automation.dll /test:Light_Oil_Price_System.Scripts.PricingScreen_Script.PricingScreenFunctionality
This works correctly.
But now I want to use the same in a batch file. Can some one help me out to create a batch file by using the above code?
Wrap paths with spaces between quotes.
I also used cd /D, that changes drive if necessary (for example if you were on drive D: you would need to change to C: before cd commands. With /D option this is done automatically)
Also, since you are already on the Common7\IDE folder, you don't need to write again the directory, you could just call MSTest.exe:
cd /D "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE"
MSTest.exe /testcontainer:D:\Working\LOPS_Testing\LOPS6Automation\bin\LOPS6Automation.dll /test:Light_Oil_Price_System.Scripts.PricingScreen_Script.PricingScreenFunctionality

C:\Program Files\Microsoft SQL Server for INSTALLSHAREDDIR parameter is not valid because the directory is not writable

During the installation of MS SQL Server 2014 on a Win 7 Pro computer I get the following error:
C:\Program Files\Microsoft SQL Server for INSTALLSHAREDDIR parameter is not valid because the directory is not writable...
There is not such a directory in the C:\Program Files\ folder! And the share directory is set to be in c:\Program Files (x86) folder anyhow, and I cannot even change it? I tried to create a directory Microsoft SQL Server in the C:\Program Files folder and set all the privileges, it still does not work! How come a MS product cannot be written into MS program folder?

Create a TXT if software exist

I'm looking for a batch script to create a text file if a software exists
For example I have this broken code
IF EXIST "C:\Program Files (x86)\Microsoft Office\root\Office16\Outlook.exe"
Create a text file here C:\Users\office2016.txt with the text "Office 2016 Install Complete"
Otherwise end the script
I'm able to create a text file with this command
#echo office 2016 installed> c:\Users\office2016.txt
I need help combining the two together.
This seems like an XY problem; what you really want is some indication that Office is installed on your system.
The command C:\Temp>if exist "C:\Program Files (x86)\Microsoft Office\root\Office16\Outlook.exe" echo Office installed >> C:\Temp\indicator.txt works fine for me so my guess is that since you're trying to write to C:\Users as a non-Administrator you don't have permission to do so.
On my system when I run as non-admin:
C:\Users>type con > test.txt
Access is denied.
C:\Users>
To find out if the user has Office installed you should be checking the registry; the REG command can do that for you:
#echo off
REG QUERY HKLM\SOFTWARE\Microsoft\Office\16.0
IF ERRORLEVEL 0 ECHO Office 2016 installed >> C:\Users\MyUsername\File.txt

Create an .inf script to open a batch file as administrator

I`ve been looking around the web for a tutorial on how to make .inf scripts so I can execute a batch file from it. The problem is that the batch script needs admin to run so i have to get that in some way. Here is my code:
:start
echo off
copy program.jar "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\"
The program needs admin to copy to the Starup folder.
Thnx.
Only for the All User's folder. Only Admins can install for all users.
The per user startup folder is at %appdata%\Microsoft\Windows\Start Menu\Programs\Startup

install windows service through batch file in a particular directory and set login credentials

I have a windows service that I need to install in a userdefined directory instead of C: drive and set login credentials for it.
I am using the below code to install the service but it installs the service in C drive instead of E drive.
E:
cd \MyService
msiexec /i MyServiceInstall.msi /L E:\MyService\MyServiceInstallLog.txt /qn
sc config MyServiceInstall obj= uid password= pwd start= auto
rem net start MyService
I want to install the service at the location where the install file, MyService.msi, is present.
How do I go around this?
You don't "get around" anything. You create a proper MSI that uses the ServiceInstall table to create the service. The ServiceInstall table has a UserName and Password column which is of type Formatted which means it can use properties like [USERNAME] and [PASSWORD]. Then you can simply say:
msiexec /i MyServiceInstall.msi INSTALLDIR=C:\INSTALLHERE USERNAME=bob PASSWORD=dontyouwhich
The only tricky part is that MSI doesn't grant the user account the SeLogonAsService right so a custom action will be needed to grant this prior to starting the service.

Resources