1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Cmd.exe /c Start

Discussion in 'Legacy Windows' started by mundenp, 2005/04/12.

Thread Status:
Not open for further replies.
  1. 2005/04/12
    mundenp

    mundenp Inactive Thread Starter

    Joined:
    2005/04/12
    Messages:
    2
    Likes Received:
    0
    Hi,


    Why is it that the START switch doesn't work when its used on a machine unattended i.e. the following command works fine when you are actually signed onto the box but if it's issued from a routine that's running in the background but when no one is actually signed on it doesn't work.

    'C:\WINNT\system32\CMD.EXE /c start "My Title" rexx.exe c:\mydir\myscript.rex'

    The same happens with the scheduler. The above command never actually works unattended but if you are signed onto the box at the time the job is scheduled it runs absolutely fine.

    Any ideas ?

    Thanks
    Paul
     
  2. 2005/04/12
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,317
    Likes Received:
    252
    "If /C or /K is specified, then the remainder of the command line after
    the switch is processed as a command line, where the following logic is
    used to process quote ( ") characters: "

    Think maybe you need to change the apostrophe to quotes.

    "C:\WINNT\system32\CMD.EXE /c start "My Title" rexx.exe c:\mydir\myscript.rex "
     

  3. to hide this advert.

  4. 2005/04/12
    mundenp

    mundenp Inactive Thread Starter

    Joined:
    2005/04/12
    Messages:
    2
    Likes Received:
    0
    Thanks but the posted code is actually running cut from another rexx script so u can ignore the apotrophes. The basic code being run is simply -

    C:\WINNT\system32\CMD.EXE /c start "My Title" rexx.exe c:\mydir\myscript.rex
     
  5. 2005/04/12
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    Hmmm - I'm gonna take a stab at this one.

    Given that it works when someone is signed on but otherwise, it fails, then are you looking at a privilege issue?

    Have you tried doing it as a RunAs and invoking an account that has rights to do whatever the script is trying to do?

    Another thought - I'm not at all sure what environment variables are loaded when no one is signed on but is it possible that the path statement that allows the system to locate rexx.exe isn't active and that putting in the full path to rexx.exe would cure your problems?

    If neither of those ideas helps then I'm gonna have to ask you to unconfuse me some.

    C:\WINNT\system32\CMD.EXE /c start "My Title "
    Appears to be firing off a cmd session, telling it (via /c) to quit when done, firing off another cmd session (via start) and feeding that 2nd session a non-command called "My Title" followed by a command and a pointer to a script.

    I have no idea how that could do anything useful. Obviously it does and it may just be a matter of my total ignorance of rexx.exe but if you could explain, I'd appreciate it.
    - why start the 2nd cmd session at all
    - why feed it something it shouldn't be able to process
     
    Newt,
    #4
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.