Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: windows run -> command prompt  (Read 10977 times)

0 Members and 1 Guest are viewing this topic.

cppeter

    Topic Starter


    Starter

    • Experience: Beginner
    • OS: Windows 7
    windows run -> command prompt
    « on: September 12, 2014, 03:15:25 AM »
    I have a command that I normally run manually in a Windows run (Windows Key + R). It starts the program and everything is fine.

    Command:
    Quote
    "C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.54\deploy\League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator 185.40.64.163:80 HePSGcqnkxXliRBtWvn7WuZKxxxspYw9 1680414939 EUW1"

    I'm trying to make a program that does this for me (c++), cause I’m not sure how to make a windows run in c++ I’m trying to do this through the command prompt. When I enter:
    Quote
    start "C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.54\deploy\League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator 185.40.64.163:80 HePSGcqnkxXliRBtWvn7WuZKxxxspYw9 1680414939 EUW1"

    I get an error (I translated it):
    Quote
    Cannot find the file 8394 Make sure you typed the name correctly, and try again

    Does anyone see what I’m doing wrong? Or have a better solution.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: windows run -> command prompt
    « Reply #1 on: September 12, 2014, 03:21:30 AM »
    Read Start /?. The first argument is Title Text, so start with a dummy "" parameter.

    You can use exec() to launch the program directly in C/C++.
    I was trying to dereference Null Pointers before it was cool.

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: windows run -> command prompt
    « Reply #2 on: September 12, 2014, 04:12:11 AM »
    Read Start /?. The first argument is Title Text, so start with a dummy "" parameter.

    This is right - just adding that you can put it in a batch script.

    Code: [Select]
    @echo off
    start "" "C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.54\deploy\League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator 185.40.64.163:80 HePSGcqnkxXliRBtWvn7WuZKxxxspYw9 1680414939 EUW1"



    cppeter

      Topic Starter


      Starter

      • Experience: Beginner
      • OS: Windows 7
      Re: windows run -> command prompt
      « Reply #3 on: September 12, 2014, 05:23:28 AM »
      I tried what you suggested Foxidrive. It does open the program, but just for a second and than returns an error. Should I change more things to the command or can I just copy it from the Windows run box command? I'm not sure what the Windows run dialog exactly does.

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: windows run -> command prompt
      « Reply #4 on: September 12, 2014, 06:38:53 AM »
      I tried what you suggested Foxidrive. It does open the program, but just for a second and than returns an error.

      I don't know what error you saw, but try this in case the working directory needs to be set.

      Code: [Select]
      @echo off
      start "" /D "C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.54\deploy" "League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator 185.40.64.163:80 HePSGcqnkxXliRBtWvn7WuZKxxxspYw9 1680414939 EUW1"


      Lemonilla



        Apprentice

      • "Too sweet"
      • Thanked: 70
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 7
      Re: windows run -> command prompt
      « Reply #5 on: September 12, 2014, 07:20:04 AM »
      It may be intentionally written into the game.  It says you aren't suppose to launch the game this way in the Terms of Use.  Getting past that, I would leave out the start command.  The script will not continue until after league of legends is closed out, but it should run the exact same as it did from run.exe
      Code: [Select]
      "C:\Riot Games\League of Legends\RADS\solutions\lol_game_client_sln\releases\0.0.1.54\deploy\League of Legends.exe" "8394" "LoLLauncher.exe" "" "spectator 185.40.64.163:80 HePSGcqnkxXliRBtWvn7WuZKxxxspYw9 1680414939 EUW1"

      Also, check to make sure that 0.0.1.54 is still the correct directory.  They like to change them up every once in a while.

      If you don't mind me asking, where did you get the  "185.40.64.163:80 HePSGcqnkxXliRBtWvn7WuZKxxxspYw9 1680414939 EUW1" information?

      EDIT: IT also might not be working due to riot disabling spectating.
      « Last Edit: September 12, 2014, 07:47:03 AM by Lemonilla »
      Quote from: patio
      God Bless the DOS Helpers...
      Quote
      If it compiles, send the files.

      cppeter

        Topic Starter


        Starter

        • Experience: Beginner
        • OS: Windows 7
        Re: windows run -> command prompt
        « Reply #6 on: September 12, 2014, 09:57:21 AM »
        I got the command from lolnexus.com. You can also find it on http://quickfind.kassad.in/ Both under the spectate buttons.

        cppeter

          Topic Starter


          Starter

          • Experience: Beginner
          • OS: Windows 7
          Re: windows run -> command prompt
          « Reply #7 on: September 12, 2014, 12:07:54 PM »
          Thank you Foxidrive, it worked you are my hero!! I was ready to give up and then you came with your brilliant idea.

          foxidrive



            Specialist
          • Thanked: 268
          • Experience: Experienced
          • OS: Windows 8
          Re: windows run -> command prompt
          « Reply #8 on: September 13, 2014, 12:00:01 AM »
          Thank you Foxidrive, it worked

          Thanks, I'm glad to hear that. :)

          I've learned something new just now from your comment - the Run dialog sets the working directory to the path of the executable.
          I just tested it with some sample files - and this is why your command worked in the Run dialog but failed in the first batch file I posted.


          If anyone is interested you can create this batch file called one.bat in say c:\test and then in the Run dialog type c:\test\one.bat

          If you open a cmd prompt in c:\ and execute c:\test\one.bat then you will get one line echoed and errors, but not from the Run dialog.

          Code: [Select]
          @echo off
          >"%~dp0\batch2.bat" echo @echo batch 2^&pause
          echo batch 1
          call "batch2.bat"
          del "%~dp0\batch2.bat"
          « Last Edit: September 13, 2014, 12:15:57 AM by foxidrive »