How to use command prompt via vb.net to use BCDEDIT - vb.net

I have a batch file which contains some commands with bcdedit.
but in my vb.net application when I run that batch file via: Process.Start("CMD", " /C \blahblah\test.bat") it says bcdedit is not recognized.
so what I've found so far is the cmd.exe that vb.net opens it doesn't recognize bcdedit command at all.

Related

Run command in terminal from IntelliJ External Tools

I want to run a command in the OSX terminal using the IntelliJ Idea External Tools. I don't want the command to run in the IntelliJ terminal.
This is what should happen when I run the tool:
The OSX terminal opens in a separate window
The command I want (with parameters) runs in the OSX terminal
The results of the command are displayed in the OSX terminal
The terminal is NOT closed afterwards
Is this possible?
This should be possible, however, I don't have a mac to test this on.
This is how you would do it in Windows. Maybe you can translate to the OSX equivalents.
Program cmd.exe
Parameters /c start "" cmd.exe /k dir
Working directory $FileDir$
cmd.exe is the terminal so substitute the OSX terminal command here.
/c passes commands to cmd.exe then exits
start "" cmd.exe is a Windows command to start an application "" means no title and cmd.exe says we are going to launch the command window again.
/k means do the command and then stay open
dir is the command I am doing (same as ls)
$FileDir$ is the IDEA macro for the the directory of the file you are clicking on. You can change this to other macros to what fits your need.

Git Bash prompt does not open - GIt bash installation

I have installed several times the package GI-1.9.4-preview20140611.exe on my Windows 8. When I try to open the git bash command window, the window opens, but it is empty, no showing the usual welcome message and the git prompt.
I have tried changing the command for the sh.exe file, which usually has the format
"sh.exe --login -i" into just "sh.exe". The shell opens then, the PS1 variable shows only the sh.exe file name and version, nothing more. Is there something wrong with my installation?
Thanks!
Your installation is fine.
The git executable(sh.exe) for Command Line Tool is a script that in order to work will be based on the your windows Command Prompt (cmd.exe)
You will need the following string to refer to Git correctly as an executable:
C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"
Or you can always 'right-click' and SELECT 'Git Bash Here' or 'Git GUI Here'

WMIC How to pass arguments/ parameters with exe

I want to call exe from remote system using WMIC direct command. for that I prepare one command here
WMIC /NODE:"RemoteSys" /USER:"domain\username" /PASSWORD:"XXXXXXXXX" PROCESS CREATE "C:\Program Files (x86)\Company\Product\productapp.exe"
But issue here is this productapp.exe is expecting an arguments/ parameters like " -p PlantA "
Question here is How to pass it ?
I tried many alternate ways but all fails like:
WMIC /NODE:"RemoteSys" /USER:"domain\username" /PASSWORD:"XXXXXXXXX" PROCESS CREATE "C:\Program Files (x86)\Company\Product\productapp.exe" -p PlantB
Output: Invalid Verb Switch
WMIC /NODE:"RemoteSys" /USER:"domain\username" /PASSWORD:"XXXXXXXXX" PROCESS CREATE "C:\Program Files (x86)\Company\Product\productapp.exe" "-p PlantB"
Output: Invalid format. Hint: = [, ].
Don't know what is paramlist & How to use that.
Can anyone help me here ?
I've had to do something similar with MATLAB. What you could try is opening a command prompt and executing the program with parameters from that command prompt.
WMIC /NODE:"RemoteSys" /USER:"username" /PASSWORD:"XXX" PROCESS CALL CREATE "cmd.exe /c cd C:/Program Files (x86)/Company/Product/ & productapp.exe -p PlantB"

Uninstalling IE 10 Using a batch file

I found a way to uninstall IE 10 using a batch file which below and it works great like it's suppose to. It uninstalls and restarts the computer after about a minute.
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-10..mum /c "cmd /c echo Uninstalling package #fname && start /w pkgmgr /up:#fname /norestart /quiet"
shutdown -r
But I wanted to take this further and Hide IE 10 from windows updates which will prevent windows to install this update actually in the future and to do that, Microsoft provides an executable file which you can download from here
http://www.microsoft.com/en-us/download/details.aspx?id=36512 After extracting this executable, you get 3 files, IE10_Blocker.adm, IE_blocker.cmd and IE10_BlockerHelp.htm and Microsoft instructions are "In the Command Prompt, goto the folder where you have extracted these 3 files and type “ie9_blocker.cmd /B” and hit Enter to set the blocker on the machine."
I decided to make one batch file for all this so right now I got this far.
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-10..mum /c "cmd /c echo Uninstalling package #fname && start /w pkgmgr /up:#fname /norestart /quiet"
mkdir “C:\IE10”
copy /Y \file01p\Users\test\public\IE Update blocker\IE10*.* “C:\IE10”
start /d C:IE10\IE10_Blocker.cmd /b
shutdown -r
mkdir “C:\IE10” This command is suppose to create the directory called IE10 on C drive
copy /Y \file01p\Users\test\public\IE Update blocker\IE10*.* “C:\IE10” This command will copy those executable from the network public folders to their C:\IE10 which I just created in the previous step.
This script doesn't work. Only up to uninstalling IE 10 it works but it doesn't create the directory and so it doesn't copy the files from the network. How can do this?
Thanks
Thanks
Try running your batch as administrator.
in an administrator : command prompt it makes the directory without issue.
also, it could be that you do not have access to make the directory on C:
you could try locating it elsewhere that you are sure you have write access.