Insert cmd remotely line Bat ?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Warfighter
Posts: 2
Joined: 20 Jul 2010 17:06

Insert cmd remotely line Bat ?

#1 Post by Warfighter » 20 Jul 2010 17:12

how do ?

@echo off
**Execute My file**
Login:"how to insert remotely?"
Password:"how to insert remotely?"
Exit

how to insert and to remotely enter a command without using the keyboard ?

Bye

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Insert cmd remotely line Bat ?

#2 Post by aGerman » 20 Jul 2010 17:26

If that means, you want to fill in a form (of a website or of another application) then it's impossible using batch.
Batch cannot emulate the keyboard.

Regards
aGerman

Warfighter
Posts: 2
Joined: 20 Jul 2010 17:06

Re: Insert cmd remotely line Bat ?

#3 Post by Warfighter » 20 Jul 2010 19:00

Want to fill the screen of the batch

when you see Login: on the screen of the commanding bat batch automatically returns the variable that I want

a set style

I entered my starting writing a command line

Login:
wrire test
password:
write pass
exit

is how?

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Insert cmd remotely line Bat ?

#4 Post by aGerman » 20 Jul 2010 20:14

Hmm, don't know exactly what you want to do.

Code: Select all

@echo off &setlocal
set "login=test"
set "pw=pass"
echo Login:
echo %login%
echo password:
echo %pw%
pause>nul



Another possibility:
You have to type Login or password to the command prompt and hit Enter.

Code: Select all

@echo off &setlocal
set "login=test"
set "pw=pass"
set /p "in="
if /i "%in%"=="Login" echo %login%
if /i "%in%"=="password" echo %pw%
pause>nul


Hope that helps
aGerman

phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Re: Insert cmd remotely line Bat ?

#5 Post by phillid » 21 Jul 2010 00:01

To do that remotely, maybe use a shared server path if you're on a LAN, and call the batch file with arguments???

Try this quick program:

Code: Select all

@echo off
title Argument Test
echo.
echo Login:    %1
echo Password: %2


To use this, type this:

Code: Select all

[the name of the program] [the login] [the password]


It will show you what you typed. You could take this further and put password verification, but just like aGerman, I'm not quite sure what you are trying to do.

Hope I helped someone!

phillid

Post Reply