Simulate keypress in bash

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Simulate keypress in bash
# 8  
Old 06-28-2018
I did not manage yet to get the net use function working but I got some progress with that script:

Code:
 
pushd \\files\share\path
start C:\"Program Files (x86)"\Program\bin\program.exe
wscript "Y:\path\script.vbs"
popd

Y is the first free letter on the server.
The program is opened, but the vbscript (see above) is not executed. It starts only when I close the program… Any clue on what happens?
# 9  
Old 07-04-2018
Quote:
Originally Posted by supernono06
I did not manage yet to get the net use function working but I got some progress with that script:

Code:
 
pushd \\files\share\path
start C:\"Program Files (x86)"\Program\bin\program.exe
wscript "Y:\path\script.vbs"
popd

Any clue on what happens?
To repeat: pushd is not capable of doing that. You really are barking up the wrong tree with this one. BASH is not a network browser.

Try net use. That is one of the only things capable of doing what you want.
# 10  
Old 07-08-2018
I got it Corona688 and in my case it works perfectly and does what I need. Of course not with bash, but with a .bat file:

Code:
 
pushd \\files\share\path
start C:\"Program Files (x86)"\Program\bin\program.exe
sleep 3
wscript.exe Y:\path\script.vbs
sleep 3
popd

This User Gave Thanks to supernono06 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash loop hording keypress input

I have a bash loop that waits for a single key press, then does $something depending on what $key is pressed before refreshing the screen with updated data. The problem I have is that the script will store additional key presses and chain them together causing the screen to redraw and the script... (1 Reply)
Discussion started by: DarkPhoenix
1 Replies

2. Programming

Simulate keypress inside a non-x application...

Hey guys, I'm looking for a solution to simulate a key-combo (tab+q) inside an amiga-emulator. I've tried it with uinput and python without any success. Any help would be great. Cheers McCarthy (5 Replies)
Discussion started by: mccarthy83
5 Replies

3. Shell Programming and Scripting

How to simulate ''Esc'' keystroke in a bash shel script?

I am using Ubuntu 12.4 I am running the following script: ++++++++ #!/bin/bash while ; do xdotool mousemove 248 539 click 1 & sleep 3 done +++++++++ This moves the mouse on the specified position on the screen and clicks that pauses the script for 3 seconds and repeats the... (2 Replies)
Discussion started by: alfarnume
2 Replies

4. Shell Programming and Scripting

How to simulate an execution queue with bash?

I'm running cygwin bash on windows 7 and I'm have some bat files that perform large builds and take a long time and a lot of memory. Therefor, I don't want to builds executing simultaneously (too much memory). How can I implement a queue so I can queue up multiple builds and only execute one... (2 Replies)
Discussion started by: siegfried
2 Replies

5. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

6. Programming

get keypress c++Qt

Hi i need to get the key pressed from the keyboard without focus on the application. i work under CentOS 5.5 with QtC++ 4.7 and Python Script (0 Replies)
Discussion started by: HanyM.Magdy
0 Replies

7. Shell Programming and Scripting

Bash KeyPress (or Read Single Character)

Hi, I'm sorry if this has already been posted somewhere but I can't seem to find it on the forums (or anywhere on google :( ) I am writing a script where a user must enter a single character to perform an action. For example, Press Q to Quit or R to Refresh Basically I am stuggling... (5 Replies)
Discussion started by: Ste_Moore01
5 Replies

8. Shell Programming and Scripting

simulate session.getMaxInactiveInterval() in bash script

hi everyone, I have a question about the java object oriented function which to simulate in bash script... here is the function "session.getMaxInactiveInterval() / 60 " got any web can read this function? coz i need to simulate to bash script... Hope someone give me a suggestion... (0 Replies)
Discussion started by: ryanW
0 Replies

9. Shell Programming and Scripting

How to trap a user keypress

Yo, I program Unix for fun- except when editing my website removed by reborg - and wanted to learn how to track, trap, and use to my advantage a user keypress. I know there is a built-in JS function that can do that, but Javascript is a client-side language, therefore not usable in Unix, and... (2 Replies)
Discussion started by: signebedi
2 Replies

10. Programming

keypress signals

How-to use keypress action signals in C? Is there any nice select or poll functions for that? (1 Reply)
Discussion started by: Esaia
1 Replies
Login or Register to Ask a Question