Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:46:49+00:00 2026-06-05T05:46:49+00:00

So – I’m using an image capture tool (snagit). By default, the image itself

  • 0

So – I’m using an image capture tool (snagit).
By default, the image itself is saved to the clipboard (after a capture).
I would prefer that the image’s path stored in the clipboard.

The application allows me to (instead) save the file, and pass the image as an argument to an external application. I’m passing it to the following .vbs file:

Dim Clipboard
Set args = WScript.Arguments
if args.length > 0 then
    arg1 = trim(args.Item(0))
else
    arg1 = "(No Data)"
end if

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "cmd /C echo "&arg1&" | CLIP", 2

This does 99% of what I want, except I find that ‘ECHO … | CLIP’ tends to append formfeed/carriage return chars to my string.

Is there a better command I can use (in either cmd/vbs)?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:46:50+00:00Added an answer on June 5, 2026 at 5:46 am

    I seriously doubt your code produces <formfeed><carriage return> on the clipboard. It should produce <carriage return><line feed> at the end. Those are the standard line termination characters on Windows. They are automatically added by the ECHO command.

    You can write to stdout without the new line using <NUL SET /P "=message"

    I don’t understand why you are using VBS when it can’t access the clipboard directly. It makes more sense to me to use a batch file.

    @echo off
    setlocal
    set "arg1=%~1"
    if not defined arg1 set "arg1=(No Data)"
    <nul set /p "=%arg1%"|clip
    

    or as a one line batch file:

    @if "%~1"=="" (<nul set/p"=(No Data)"|clip) else <nul set/p"=%~1"|clip
    

    If you really want to use VBS, then here it is

    Dim args, arg1, objShell
    Set args = WScript.Arguments
    if args.length > 0 then
      arg1 = trim(args.Item(0))
    else
      arg1 = "(No Data)"
    end if
    
    Set objShell = WScript.CreateObject("WScript.Shell")
    objShell.Run "cmd /C <nul set /p ""="&arg1&""" | CLIP", 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I have a simple restful service that transforms a JAXB-anntotated beans to response XML
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I need a function that will clean a strings' special characters. I do NOT
I have a PHP application that stores PHP datetime to my MySQL table. I
I am getting notice on line 30 that twetout is undefined variable <?php $username
The problem with unsigned char. I am reading a PPM image file which has
I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
So to start, I have an array of XML files. These files need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.