Output to clipboard instead of a File

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Output to clipboard instead of a File

Post by kpassaur » Sat May 27, 2006 4:59 pm

I am trying to determine if an application is installed on a PC without creating a temp file and reading it.

The goal is to have an Autorun CD (that part is no problem) that when it is run checks to see if Acrobat is installed. The dos command below works
and I could direct the output to a file such as c:\temp\testacrobat.txt and then see if the string "File association not found for extension type" exists in the file. However, since it is a standalone CD and it is going to be distributed I would prefer that it didn't write anything to users PC.

Does anyone know of another way of doing this? Like direct the output to the clipboard etc or another way to test if an application is installed. The file association method seems to me to be the best as it disregards versions and with Acrobat maybe they like a different viewer.


C:\Documents and Settings\Keith Passaur>assoc .pdf
.pdf=AcroExch.Document

C:\Documents and Settings\Keith Passaur>assoc ape
File association not found for extension ape

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat May 27, 2006 11:38 pm

If you finally do need to write somewhere to do this, here are two thoughts:

1. Many years ago it was commont to make RAM drives.

Is it possible that you could create a temporary RAM Drive? Write to it as needed, and then deleted the drive when done?
-------------
2. How about writing to a temp folder, then deleting when done? Net result is nothing is on machine.
------------
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Found a way to output dos to the clipboard

Post by kpassaur » Sun May 28, 2006 9:27 am

Bob, thanks for the response. I thought of the ram drive but forgot how to do it, however in my research I found a little know component that Microsoft has called "Clip.exe". It is a small exectuable, 6k and if you run it you can write to the clipboard. Here is the code that make it possible to check for a pdf viewer.


Run Program>Clip.exe
Run Program>cmd /c assoc .pdf |Clip
Wait>1
GetClipboard>clipboard


I have gotten it to work with this script and can see what a great complement it is to Macro Scheduler. I appears to be for free distribution as it is available at this Microsoft ftp site.

ftp://ftp.microsoft.com/Services/TechNe ... skit/FILE/

There are other utilities on this site as well and they maybe usefull as well.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun May 28, 2006 9:37 pm

Don't forget MJT's Clip Magic also.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts