I have created a batch file to open a browser. But I need to know how to interpret the user name and password from the batch file.
Below is my batch file. Can anyone please help?
FYI, I'm just using the normal .bat file (from notepad).
#ECHO ON
start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE https://www.myhcl.com/Login/home.aspx
There is no "native" way for a bat file to interact with a window. I would use powershell or VB script for this task but it will be quite a mess.
An easy way is to use AutoIt. It's realy simple and allows you to fully interact with a browser. You could ither use the AutoIt interpreter from within your bat file to manipulate the browser window or just create an au3 or even an exe file that starts the browser and enters the login data.
If you decide to use AutoIt and need help with the script just ask me.
Related
So i have been looking for this on this website and cannot seem to find it so im asking you how to do it
If you are looking to display a list of processes from the command prompt you can use TaskList.exe if you are looking to just open the windows Task Manager you can use TaskMgr.exe
For standard batch file you would just use tasklist.exe. If you were using powershell you would use start-process tasklist.exe -nonewwindow.
I created a batch file to start several programs, including Task Manager. I used this code:
cd C:\ProgramData\Microsoft\Windows\Start Menu\Programs
start taskmgr
if this path does not work for you, right click on the task manager app and look at the path in the "properties"
start taskmgr
should work :)
(tested, it works!)
You can use this with a batch file: start "" TaskMgr.exe
I tried it on Windows 11, it worked fine.
I regularly clear a log file as I run some tests and I want to keep that log readable.
I have a batch file using the command below that works whenever the program that is being logged is turned off.
del /f *.log
When the program (a tomcat server) is running, I have an 'access is denied' error because the file is being used by another service.
I don't want to turn the tomcat off and on every time. My current workaround is to edit the log into notepad++, select all, delete, save and close notepad++.
Is there a more efficient way of doing that? I have a few batch to clean multiple times a day so I would like to automate.
Is it possible to create a .bat that would do that for me? I thought of exporting a notepad++ macro into a batch file but my various research were not successful.
I tried:
echo off
echo. > filename.log
but the result is the same => access is denied because the file is already in use.
I use a remote support program to access agent's computers to set them up to work with our dialer.
I use a script via that remote program that adds IE shortcuts to their desktop. To make this script work for any variety of computer setups, the shortcuts are created on the AllUsersDesktop.
I also install a program (called Ventrilo) that creates a shortcut on the specific desktop they are on when I remote into their system.
I would like to add a batch file they can execute that will automatically open the shortcut to Ventrilo and open the IE shortcut on the AllUsersDesktop.
The batch file I have is as follows:
#echo off
start Ventrilo.lnk
start Shortcut.lnk
This opens Ventrilo but not the Shortcut. I am certain it is because the Shortcut is on the AllUsersDesktop, while the shortcut to Ventrilo is not. However, I cannot figure out how to use that start command in conjunction with %AllUserDesktop%
%allusersprofile%\desktop\shortcut.lnk
Type set in a command prompt.
You can start IE by calling start on iexplore, no need to run the shortcut.
start iexplore
Alternatively GoughW's answer should do the trick to.
Make sure you have an end line at the end of your
start shortcut.lnk
in your batch file.
I have a set of batch files. Some of them are shortcuts to long running tasks, like an FTP server. I want to launch them in a separate tab, so that I can look at the output later. I've found the -new_console option, but it doesn't seem to work on batch files (while it does work on plain executables) - ftp.bat -new_console will run in the same console.
Is this by design? If so - is there a workaround?
UPD1: As I suspected, cmd /c ftp.bat -new_console did work. Looks like ConEmu doesn't count .bat or .cmd as executables. Though, the question remains the same.
When you type in your prompt "ftp.bat" cmd don't start new process, it reads file and execute it contents internally.
ConEmu process "-new_console" when shell create new process only.
So, if you need to start cmd/bat in new console - use "cmd /c " or alias for example. Also, you may use "-new_console" inside of batch file, when you starting ftp or any other process.
I would like to create a batch file that brings up the Windows "Turn off computer" window, rather than the user doing so through the usual Start / Turn off Computer method.
Here's a picture of the window I would like to bring up using a DOS batch file :-
http://i.imgur.com/dMprQ.jpg
Does anyone know of a way to do this using a DOS / Batch file method ?
Many thanks,
Martin
Shutdown windows with batch file