topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 15, 2024, 12:09 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Starting CHS via batch file quandary  (Read 6350 times)

Paul1149

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 45
    • View Profile
    • Donate to Member
Starting CHS via batch file quandary
« on: January 10, 2013, 07:14 AM »
Hi,

I'm trying to call CHS along with some other programs via a batch file that will delay their opening upon boot up. The problem I'm having is that if I just place the file path to CHS on a line, it opens fine, but the batch processing goes into wait mode and nothing else gets done. But if I use a Start command, a second CMD windows spawns but CHS does not execute. I'm not clear on why the Start command does not successfully execute CHS.

Thanks

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Starting CHS via batch file quandary
« Reply #1 on: January 10, 2013, 03:37 PM »
If you want to delay programs on start-up, an alternative approach might be to use WinPatrol.  I have to add I only presume this works in the free version, as I'm a registered user.

You haven't got spaces in your path to CHS, have you?  If so, I think you'd need to wrap the path in quotes (though if you're using batch files, you'll already know that).

Paul1149

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 45
    • View Profile
    • Donate to Member
Re: Starting CHS via batch file quandary
« Reply #2 on: January 10, 2013, 04:51 PM »
WinPatrol is an excellent program. I stopped using it only because I wanted to cut down on running processes.

Yes, there is a space or two, and yes I am using quotes. If I run the file path in a command window, CHS starts up with no problem. Somehow it's not complying with Batch syntax.

Thanks.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Starting CHS via batch file quandary
« Reply #3 on: January 14, 2013, 09:57 AM »
I'm using Vista Home Premium, UAC On, user account, and CHS is installed as portable in a "no-install" directory.  This works for me:

TEMP.BAT
@echo off
start "CHS" "c:\NoInst\ClipboardHelpAndSpell\ClipboardHelpAndSpell.exe"
cls
exit

The command window flashes on screen momentarily, then disappears, and CHS loads correctly.  I looked at the syntax for START.  In part it shows:


START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/AFFINITY <hex affinity>] [/WAIT] [/B] [command/program]
      [parameters]

    "title"     Title to display in  window title bar.


I originally tried

start "c:\NoInst\ClipboardHelpAndSpell\ClipboardHelpAndSpell.exe"


and found the window title was actually "c:\NoInst\ClipboardHelpAndSpell\ClipboardHelpAndSpell.exe".  That made me wonder if "title" is now obligatory, though now, with the ersatz title, it just says cmd.exe.  Still not as neat as I'd like as I'd prefer the cmd window not to flash on screen.  Are you running a scheduler, or something with a scheduler in it, like PowerPro?  If so, could you use that instead?  In that case, you could probably run a .lnk instead of a batch.

Paul1149

  • Supporting Member
  • Joined in 2012
  • **
  • default avatar
  • Posts: 45
    • View Profile
    • Donate to Member
Re: Starting CHS via batch file quandary
« Reply #4 on: January 14, 2013, 10:17 AM »
RJ - untested as yet, but I believe you've hit on the problem.  I ran into this very recently in another batch file, that I use to install a bunch of programs silently. I had used the empty Title spec, "", for the Start command, but when I saw it shown as optional in the Help file (and there is no mention of it in its Notes either), I deleted it for conciseness, and then began having all sorts of problems. It took me weeks and some help to figure out that the Title spec is necessary when quotes are used in the file path, otherwise the file path is interpreted as a Title. And my CHS file path does have quotes.

Will make the switch, and fully expect this to solve the problem. Thanks much!

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Starting CHS via batch file quandary
« Reply #5 on: February 11, 2013, 04:51 PM »
See this message: Re: Windows Batchfile can't recognize long file name...!!!!

Strange to have two threads on the relatively unpopular area of command lines at the same time...