how do i make a batch program that types - windows

hi i am interested in making a batch program that allows me to be able to place my cursor anywhere and have the batch program type for me as if i'm typing. i have looked at a lot of different sites for help but it might be it's impossible with batch programming or i just need someone on here to tell me how your input is much appreciated. i have tried to use echo >>etc .text commands but that only inserts input into that specific text document. I would like to know this because it would improve my batch programming and would be a valuable tool to have.

Ok, after a bit of thinking, the only way to do this is to update the clipboard with whatever you want to "type" into the program, and then press "Ctrl + V" to paste it. The way you would go about inmplementing this is up to you, but to place something in the clipboard via batch is:
Clip < file.txt
And you would have to make a batch file which would continuosly update the clipboard with whatever you wanted to paste. The way you do this is up to you.
Other then that, I dont see any other way you could do something like this in batch. Like I mentioned your better off doing this in C#.
Mona

Related

Possible to copy/move/etc multiple files of same base name via Windows CMD/.BAT?

I am wondering if it is possible to accomplish the following, given some context and example.
I have files in "Server\Share\Folder\File##.ext"
Sometimes the "File##.ext" can be "File01.ext" through "File20.ext", and other times it may be "File01.ext" through "File40.ext"
Sometimes there are less of these files, sometimes there are more.
I want a batch file to take the files from "Server\Share\Folder\File##.ext" and move them to "Server\Share\OtherFolder\File##.ext". I know I can accomplish this easily with:
copy /y "Server\Share\Folder\File01.ext" "Server\Share\OtherFolder\File01.ext"
Then just add another line for each extra "File02.ext, File03.ext, etc., but I am wondering if it is possible to make it so that any file that resembles "File##.ext" can be included, so that no matter how many ## I have, it always works without issue.
Thanks in advance for any and all advice!
EDIT
Someone mentioned using Wildcards, but my question with that is - lets say those files are File01.ext through File05.ext, will it match what it finds to the newly moved file? Like will it find File01 from File?? on the source and Make it File01 from File?? at the destination?
You can accomplish this task with a FORloop program in batch-file.
You can also loop through the Commands using : and variable name.
Combining these two would help you get what you want.
We can help you with Ideas and little bit of the coding. But the Efforts must be done by you. So U can learn programming better

Beginning programming: Simple/Quick work log application

I want to create a simple work log program/script with very basic function. Basically when I run it I want it to prompt me with an input windows. When I write the input it prints it into a .txt file with the current date and time.
Input : <text here>
and the output would look something like this in a .txt file.
<HH:MM:SS YYYY:MM:DD> | <text here>
What programming language is "easiest" for this kind of a program ?
With regards,
H
Ok, well I think your question is going to be a bit difficult to answer head on. How about asking yourself what language you do know. If you don't know any, then take the problem you are trying to solve each step at a time with documentation that your comfortable with. Do you want a program that strictly uses the command line? Or do you want a program with a GUI? That being said, I preferably would recommend Java because I think the syntax is more clear to me, but someone might recommend, say language X because they might know a few easier tricks. So my advice is, do some more research into a programming language and come back with more of a precise question that relates to the results your looking for.

Custom Input For Command Prompt?

What I'm looking for seems to be very simple. I want to run a command prompt line, but have it to be easily editable for anyone to use. There are multiple commands to this script, but only one part needs to be changed, and asks the user for a custom input. I'm sure this is already online, however after looking for hours and finding nothing as I have no clue what it would even be called, this is my last resort. Any help would be appreciated as I'm not even quite sure how to describe this.
Your question is a bit vague but if I understand correctly it sounds like you are trying to read user input (ie. prompt the user for input) from a batch file. If so, this should work for you:
set /p CustomInput="Please enter blah blah blah.."
Then you can use %CustomInput% as a variable in the script.
I guess you may also add this line:
goto %CustomInput%

PowerBuilder and batch processing

I'm using PowerBuilder 10.5 and as a newbie I'm a bit stuck and since Google isn't giving me a satisfying answer I'm asking some advice from the Stack Overflow group.
I have a Rich Text Edit field in which the user can write something, insert pictures and so forth. Once finished, he goes to the „Search“ command button and clicking it searches for the batch file that will suit his needs (copy that text into an existing word document, create a new word and place the folder on web, and so fort – there are 6 different batches). The code in the clicked event of „Search“ command button is this:
String ls_s
GetFileOpenName('PB_app', ls_s, ls_s, 'BAT', "Win Batch Files (*.BAT),*.BAT", 'C:\Programs\Test')
And here come my problems: I can't connect my app and the selected batch file. I'd like the path of the selected batch file to be visible in the Single Line Edit filed, but I have no idea how to get there, not to mention I'm point blank at how to connect PB app, batch file, how to even say to the batch file – „That text in rich text edit field is the one you have to work with?“…?
So I need some advice, guidance, perhaps some links or names of any literature that would help me understand how it should be done. I've lost two days and got nowhere, and I just need some piece of advice to get me going…
Your problem is that the original programmer used one variable for two return values. If you declare a new string variable and pass it instead of the first ls_s, you'll see this will return you the path. If you run into trouble, PB has a good help file (and the manuals are also online) which covers GetFileOpenName().
Good luck,
Terry

capturing what keys were used to launch vbscript

I have an application that has 'macro' capabilities. When I map some keys on the keyboard to perform the 'macro', I can also have it launch vbscript instead.
What i'd like to try and do is within my vbscript figure out what keys were used in order to launch the script. Is it posible to do this? Could there be a way in vbscript to figure out what keys were last touched on the keyboard and then I could apply my logic.
The purpose of doing this is to keep the code in a single .vb file instead of several seperate .vb script files(one for each keyboard mapping, possible 3-4). Obviously we are looking to just maintain 1 file instead of multiple files with essentially the same code in each one.
I am leaning towards the idea that this is not possible, but i figured this would be a worthy question for the masses of StackOverflow. Thanks for the help everyone!
What you are asking for is not possible.
Can you change your VBScript to accept parameters and then call it with a different parameter based on which hotkey was selected?
I agree with aphoria, the only way to make something like this possible is if your keyboard mapping software allows you to assign a script/command with parameters/arguments. For example if you used
c:\Temp\something.vbs
then you would change this to
%WINDIR%\system32\wscript.exe c:\temp\something.vbs "Ctrl-Alt-R"
Then in your vbscript code you could collect the argument using the wscript.Arguments object collection to do actions based on what argument/parameter was passed. See the following two links for more info:
http://msdn.microsoft.com/en-us/library/z2b05k8s(VS.85).aspx
http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept04/hey0915.mspx
The one possible approach you may use is to install keylogger and read its log in your VBScript.
For example save script start time in the very beginning of the script
StartTime = Timer()
and then read one log record of your keylogger before this time.

Resources