| 1. |
Solve : Batch file that i can run and paste text from? |
|
Answer» I have tried searching for this but have come up wtih nothing. I have to update tickets at my job with the current date and time like this:: Ticket RECEIVED from company to company at 18 JAN 07 @ 12:15:01. I need to enter this info about 100 times a day and i was wondering if there was a batch file i could run that would allow me to click on it and then go into my program and paste and it would give me the line with the current date and time. does anyone know how i could do this?? Much appreciated.Batch scripts cannot do this, even vbscript wont, a program that can interact with the clipboard is what you need I have tried searching for this but have come up wtih nothing. I have to update tickets at my job with the current date and time like this:: Ticket received from company to company at 18 JAN 07 @ 12:15:01. I need to enter this info about 100 times a day and i was wondering if there was a batch file i could run that would allow me to click on it and then go into my program and paste and it would give me the line with the current date and time. does anyone know how i could do this?? Much appreciated. I could use a batch file and a free utility program to create and write to a text file with the date and time in just about any format, including the one you've asked for. But, like gpl said, I don't know a way to automate getting it into the clipboard. You'd have to open that text file with something like Notepad. Highlight, and click Copy. Then you could paste away. If doing it this way is of any use to me, let me know and I'll show you. Nothing to it. Got it. - A way to do it by clicking on a batch file. It works under Win98SE. You need two free utility programs and a batch file to run them. 1.) Go here: http://www.ferg.org/fdate/ Download Fdate - fdate16a.zip 2.) Go here: http://home.mnet-online.de/horst.muc/wbat32.htm Download ClipText 1.3 - cliptext.zip 3.) Make a unique folder and unzip them both in it. 4. ) Use the following to make a batch file, and put it in that folder too. Code: [Select]@echo off rem Writes output of fdate to text file named datetime.txt rem Example : 19 Jan 07 @ 12:05:54 rem If datetime.txt already exists, it will be overwritten fdate /Ff /C"~~D ~n ~y @ ~H:~U:~S" > datetime.txt rem execute cliptext.exe - have it read datetime.txt to the clipboard cliptext from datetime.txt Name the batch file datetime.bat , or whatever you want. Double click the batch file to run it. Now try pasting. Did it work? Hope so. All I can say is that it worked for me. No guarantees. Edit: There are extensive docs and examples with Fdate. It can do a lot of different things. There are very short docs with Cliptext. It appears to be a very simple program with only a couple options. Well then is there a way that i could have an application that i could just open and it would have a line in there that would generate the current time so that i could just highlight it everything and then go in and paste it into my application. If so, does anyone know the command.Quote Well then is there a way that i could have an application that i could just open and it would have a line in there that would generate the current time so that i could just highlight it everything and then go in and paste it into my application. If so, does anyone know the command. See above. That batch file, running fdate with that command line, will create a file named datetime.txt . In it is one line. Example: 19 Jan 07 @ 14:04:21 You could open datetime.txt with Notepad, hightlight, copy, then paste. But FIRST, you should try using that batch file as written, with cliptext. It worked fine for me. Every time I double clicked the batch file, my clipboard was updated so that I could paste the date and time in the above format.... which is what I thought you wanted to be able to do. Thanks, that worked great. I have one more question. I need to have ticket say: TICKET RECEIVED FROM COMPANY TO COMPANY ON CURRENT DATE @ CURRENT TIME. Let me know if you know where to put that on your code. Anyways thank you very much for that i have been trying to find this for a while. Quote QuoteQuoteWell then is there a way that i could have an application that i could just open and it would have a line in there that would generate the current time so that i could just highlight it everything and then go in and paste it into my application. If so, does anyone know the command. Thanks, that worked great. I have one more question. I need to have ticket say: TICKET RECEIVED FROM COMPANY TO COMPANY ON CURRENT DATE @ CURRENT TIME. Let me know if you know where to put that on your code. Anyways thank you very much for that i have been trying to find this for a while. I'm not 100% sure of what you are asking. You need to rephrase it. In the meantime, if you comment out the fdate line in that batch file, and use: Code: [Select]fdate /Ff /C"~~D ~n ~y @ ~H:~U:~S" /P"TICKET RECEIVED FROM COMPANY O COMPANY ON " > datetime.txt You'll get : TICKET RECEIVED FROM COMPANY TO COMPANY ON 19 Jan 07 @ 15:00:33 when you paste. Just a very newbie to this site, thought I'd though a little addition to your batch problem: At the end of the batch, you can add this line so batch file will open the text file in notepad for you: start notepad datetime.txtAll of this worked great, I thank you all for your help. JuppeQuote All of this worked great, I thank you all for your help. Great! I thought we'd want to work on that "COMPANY TO COMPANY" part next. But if it good the way it is, that's fine too. I went in and edited that part of it and figured it out. i just needed to know how to do the date. JuppeQuote I went in and edited that part of it and figured it out. i just needed to know how to do the date. Great! I was expecting that the "company" part would not be a constant. If those were changing, that you'd need to find a way to easily substitute for them. I'm glad you got it going. I hope it saves you time. |
|