how to add <Enter> on a new line in a .bat file

  • Thread starter Thread starter JW
  • Start date Start date
J

JW

How can I add a line in a .bat file, that will send the <Enter> key ? Hope
this is not a dumb question. I tried pressing Enter on a blank line in the
..bat file, but as I imagined, it behaved like a line with nothing on it.
What I'm trying to do is use the Startup folder to automatically Synchronize
an Active Desktop item, by running a .bat file that runs Mobsync.exe,
followed by sending an <Enter> keystroke. Sending the Alt+S keystroke
combination would also achieve the desire effect.

I also tried and failed to locate any Help for Mobsync, that would show me a
parameter to achieve the same desired effect. I already know an
alternative. I can go out, and download a keystroke recorder program, which
I will eventually do anyway for more complex macros. But if at all
possible, I would like to learn how to do it in a .bat file. Sometimes,
Quick and Dirty is simpler. Thanks for your help.

I came here from the XP Basics newsgroup, where the response was a VBscript
program. Problem with that is, when I want to do something similar again
someday, I don't want to go asking somebody to write me another VBscript
program.
 
P.S. forgot to mention that I'm obviously new in this newsgroup.
This newbie would greatly appreciate any tidbits of advice.


How can I add a line in a .bat file, that will send the <Enter> key ? Hope
this is not a dumb question. I tried pressing Enter on a blank line in the
..bat file, but as I imagined, it behaved like a line with nothing on it.
What I'm trying to do is use the Startup folder to automatically Synchronize
an Active Desktop item, by running a .bat file that runs Mobsync.exe,
followed by sending an <Enter> keystroke. Sending the Alt+S keystroke
combination would also achieve the desire effect.

I also tried and failed to locate any Help for Mobsync, that would show me a
parameter to achieve the same desired effect. I already know an
alternative. I can go out, and download a keystroke recorder program, which
I will eventually do anyway for more complex macros. But if at all
possible, I would like to learn how to do it in a .bat file. Sometimes,
Quick and Dirty is simpler. Thanks for your help.

I came here from the XP Basics newsgroup, where the response was a VBscript
program. Problem with that is, when I want to do something similar again
someday, I don't want to go asking somebody to write me another VBscript
program.
 
P.S. forgot to mention that I'm obviously new in this newsgroup.
This newbie would greatly appreciate any tidbits of advice.


How can I add a line in a .bat file, that will send the <Enter> key ? Hope
this is not a dumb question. I tried pressing Enter on a blank line in the
.bat file, but as I imagined, it behaved like a line with nothing on it.
What I'm trying to do is use the Startup folder to automatically Synchronize
an Active Desktop item, by running a .bat file that runs Mobsync.exe,
followed by sending an <Enter> keystroke. Sending the Alt+S keystroke
combination would also achieve the desire effect.

I also tried and failed to locate any Help for Mobsync, that would show me a
parameter to achieve the same desired effect. I already know an
alternative. I can go out, and download a keystroke recorder program, which
I will eventually do anyway for more complex macros. But if at all
possible, I would like to learn how to do it in a .bat file. Sometimes,
Quick and Dirty is simpler. Thanks for your help.

I came here from the XP Basics newsgroup, where the response was a VBscript
program. Problem with that is, when I want to do something similar again
someday, I don't want to go asking somebody to write me another VBscript
program.
See tip 2531 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
If Mobsync.exe is a pure console program, it might respond to ..

echo. | Mobsync.ex

The Alt-S is out of the question in a batch procedure

If the program is a WinGUI program, you will need to resort to the Windows Script Host Sendkeys method

Tom Laveda

----- JW wrote: ----

How can I add a line in a .bat file, that will send the <Enter> key ? Hop
this is not a dumb question. I tried pressing Enter on a blank line in th
..bat file, but as I imagined, it behaved like a line with nothing on it
What I'm trying to do is use the Startup folder to automatically Synchroniz
an Active Desktop item, by running a .bat file that runs Mobsync.exe
followed by sending an <Enter> keystroke. Sending the Alt+S keystrok
combination would also achieve the desire effect

I also tried and failed to locate any Help for Mobsync, that would show me
parameter to achieve the same desired effect. I already know a
alternative. I can go out, and download a keystroke recorder program, whic
I will eventually do anyway for more complex macros. But if at al
possible, I would like to learn how to do it in a .bat file. Sometimes
Quick and Dirty is simpler. Thanks for your help

I came here from the XP Basics newsgroup, where the response was a VBscrip
program. Problem with that is, when I want to do something similar agai
someday, I don't want to go asking somebody to write me another VBscrip
program
 
The solution is even simpler. Depending on how you configured the
synchronization to happen, what you need is:
mobsync.exe /logon
mobsync.exe /logoff

This is what I do to trigger offline files to sync.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
How can I add a line in a .bat file, that will send the <Enter> key ? Hope
this is not a dumb question. I tried pressing Enter on a blank line in the
..bat file, but as I imagined, it behaved like a line with nothing on it.
What I'm trying to do is use the Startup folder to automatically Synchronize
an Active Desktop item, by running a .bat file that runs Mobsync.exe,
followed by sending an <Enter> keystroke. Sending the Alt+S keystroke
combination would also achieve the desire effect.

I also tried and failed to locate any Help for Mobsync, that would show me a
parameter to achieve the same desired effect. I already know an
alternative. I can go out, and download a keystroke recorder program, which
I will eventually do anyway for more complex macros. But if at all
possible, I would like to learn how to do it in a .bat file. Sometimes,
Quick and Dirty is simpler. Thanks for your help.

I came here from the XP Basics newsgroup, where the response was a VBscript
program. Problem with that is, when I want to do something similar again
someday, I don't want to go asking somebody to write me another VBscript
program.
 
Back
Top