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.
Related
I have used itextsharp library to generate pdf in my asp.net web application. It was working fine untill today when suddenly my laptop on which the application was running in the debug mode went off. When I switched on my laptop again and tried to run the application I satrted getting this error:
"Could not load file or assembly 'itextsharp, Version=5.5.0.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its
dependencies. The parameter is incorrect. (Exception from HRESULT:
0x80070057 (E_INVALIDARG))"
What could be the reason and how can I solve this? Please help.
Try removing the reference and add again...!!! Seems like the reference got removed due to improper shutdown.
Try to clean Temporary Files of Asp.Net, sometime I've experimented strage cases of files corruption(I know this should be a comment but It's verbose):
1 - Open notepad and paste the following.
#ECHO OFF
ECHO Performing IIS Reset
IISRESET
ECHO Deleting Cache
Del /F /Q /S %LOCALAPPDATA%\Microsoft\WebsiteCache\*.*
Del /F /Q /S %LOCALAPPDATA%\Temp\VWDWebCache\*.*
Del /F /Q /S “%LOCALAPPDATA%\Microsoft\Team Foundation\3.0\Cache\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*.*“
ECHO Complete
2 - Save the file as a .bat file.
3 - run it from the command prompt.
I had a backup of my project. Restored the backup and it worked. Thanks for all the suggestions.
I want to create batch file to start/stop catalina.bat file on window server.
#echo off
cls
cd D:\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75\bin
catalina.bat start
this is what I create but not working.
If you type CD /? at the command prompt you'll note it has a /D option for changing drives.
You could therefore try:
#Echo Off
ClS
CD /D "D:\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75\bin"
catalina.bat start <args>
If you don't need to have your working directory as the \bin location you could just use:
#Echo Off
ClS
"D:\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75\bin\catalina.bat" start <args>
To stop it, repeat the last line, ending it with stop instead of start
Edit
If you really do need to use it, and given that you said the Call command works, you could use…
Either:
#Echo Off
ClS
Rem start it
Call "D:\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75\bin\catalina.bat" start <args>
Rem Do some other stuff
Timeout 120 >Nul
Rem stop it
Call "D:\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75\bin\catalina.bat" stop
Or:
#Echo Off
ClS
Rem Make \bin directory current
CD /D "D:\apache-tomcat-7.0.75-windows-x86\apache-tomcat-7.0.75\bin"
Rem start it
Call catalina.bat start <args>
Rem Do some other stuff
Timeout 120 >Nul
Rem stop it
Call catalina.bat stop
If you want to create a .bat file to start your Tomcat, then here it goes:
Declare the JAVA_HOME & CATALINA _HOME path in the system environment variables.
Create a file in Notepad with the .bat extension and put the following code within the respective Tomcat directory:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
C:
cd C:\Program Files\Apache Software Foundation\Tomcat 9.0 //Enter Your Tomacat Path
call .\bin\catalina jpda start
Check out the image attached for more detailed explanation.
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'
I know how to silently install an msi by using /qn. I also know how to download something just by using the command start http://www.example.com/file.exe. But how do I put these two together in a batch file?! I want to download it, then install it, all silently.
Try start /w URL to see if it will modally wait. If not, download wget for Windows and use it with that start /w option:
start /w "wget -c http://example..."
start /w "file /qn"
if not errorlevel 1 echo Success!
There may be gotchas, but this should push you in the right direction.
I desperately need help to create a vb / dos code which will do the following:
Check if a command prompt window is running with the following command: mgms A1 (mgms is a custom command)
If it is running, exit.
If it is not running, start cmd prompt and run the command , exit
Thanks a lot for your help!
The Windows cmd.exe batch language is horrible, but you should be able to put this in a batch file and get it working:
tasklist /FI "IMAGENAME eq mgms.exe" 2>&1 | findstr /B "INFO: No tasks running" > tmp
for /F "delims=" %x in (tmp) do mgms A1
You may need to further check that the command-line arguments to mgms.exe match what you expect -- have a look at the help for tasklist.exe and findstr.exe. Both programs are both standard in WinXP Pro and up, I believe. If you don't have them, I'm sure you can find them or (near) equivalents on the web.