[resolved] execute ssh commands with putty from a .bat
Solved
roideseaux
Posted messages
274
Status
Member
-
roideseaux Posted messages 274 Status Member -
roideseaux Posted messages 274 Status Member -
Hello,
I'm trying to execute some commands with putty from a batch file, but I don't seem to be having any luck.
The commands I'm trying to execute are just (for now) opening the midori browser on my remote host (a raspberry), so here are the codes I have for now:
My .bat file:
and my commands.txt file:
These commands work perfectly when I type them manually, but when I run the .bat, a window just opens and closes...
Thanks to anyone who can help :)
Edit:
Okay, I didn't capitalize DISPLAY...
everything works!
Configuration: Windows 7 / Firefox 47.0
I'm trying to execute some commands with putty from a batch file, but I don't seem to be having any luck.
The commands I'm trying to execute are just (for now) opening the midori browser on my remote host (a raspberry), so here are the codes I have for now:
My .bat file:
start /w putty.exe -load "SESSION" -l pi -pw raspberry -m commands.txt
and my commands.txt file:
export DISPLAY=:0
midori -e Fullscreen -a http://192.168.1.50
These commands work perfectly when I type them manually, but when I run the .bat, a window just opens and closes...
Thanks to anyone who can help :)
Edit:
Okay, I didn't capitalize DISPLAY...
everything works!
Configuration: Windows 7 / Firefox 47.0
2 answers
-
Hi,
Thank you for the feedback.
Two small things:- Gnu/Linux is case-sensitive (unlike Windows)
- Environment variables are always defined in uppercase
--
_______________________________ ☯ Zen my nuggets ☮ ______________________________
Make a gesture for the environment, close your windows and adopt a penguin… 🐧 -
Actually, I'm going to repost because it's a continuation...
The commands are executing well but the window doesn't close... I have to close it manually :/
Is there a command to make it close automatically after execution?