Help with closing cmd window after code has run

oobymach 0 Reputation points

Here's my code

set x=createobject("") "%comspec% /k ""C:\Users\Go\Desktop\Debug\PBO2 tuner Shortcut.lnk"""

Which works to run the shortcut with arguments intact but it leaves an open cmd window afterwards, adding exit and quit at the end produced errors running the script, any help is appreciated.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,543 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 81,361 Reputation points

    You don't need %comspec% /k to launch a link with parameters or not

    For example, this launches Notepad with a txt file :

    set x=createobject("") "C:\Users\Christian\Desktop\TestNotepadLink.lnk ""e:\test.txt"""

    0 comments No comments

  2. Limitless Technology 43,916 Reputation points

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query

    You can try this command instead:

    start /wait cmd.exe /c "my_command.bat"

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments

  3. Limitless Technology 43,916 Reputation points

    Double post

    0 comments No comments