1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

CMD developer help

Discussion in 'Software Development' started by desmin, Jul 10, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. desmin

    desmin Banned Thread Starter

    Joined:
    Jul 10, 2007
    Messages:
    57
    Hey, ive made about 4-6 usefull BAT files
    but with this BAT file script im having trouble. Its suppose to open up google in IE7 and also what ever the user typed in it will search that in google heres my code

    Code:
    @echo off
    
    echo Enter Your Search Here
    
    REM *this is suppose to be where there types *
    REM *then it goes at the end of the URL to open* 
    
    
    call "C:\Program Files\Internet Explorer\iexplore.exe" "www.google.com/search?hl=en&q="
    so i dont know how to do this even the COMPUTER MASTA needs help sometimes
    thx in advance
     
  2. HalTrout

    HalTrout

    Joined:
    Mar 22, 2007
    Messages:
    911
    I copied your call line into a cmd file and it worked fine????
     
  3. desmin

    desmin Banned Thread Starter

    Joined:
    Jul 10, 2007
    Messages:
    57
    no no no i want a user to be able to enter text and it goes at the end of the url to open
     
  4. HalTrout

    HalTrout

    Joined:
    Mar 22, 2007
    Messages:
    911
    See what you mean now. It doesn't pickup the search argument.
     
  5. desmin

    desmin Banned Thread Starter

    Joined:
    Jul 10, 2007
    Messages:
    57
    it will when a user adds text ot be put in at the end of the URL to open
     
  6. dez_666

    dez_666

    Joined:
    May 29, 2007
    Messages:
    842
    You can do this in C++ and it would be really easy to do. If you'd like I can guide you through how to do it.
     
  7. desmin

    desmin Banned Thread Starter

    Joined:
    Jul 10, 2007
    Messages:
    57
    im learnnig VB.NET so i dont know any C++ but i want to know how to do it
    PS this forum is great really fast replys too
     
  8. dez_666

    dez_666

    Joined:
    May 29, 2007
    Messages:
    842
    I'm actually still learning C++ myself and know..very little. But I should be able to come up with some code for this :D
     
  9. desmin

    desmin Banned Thread Starter

    Joined:
    Jul 10, 2007
    Messages:
    57
    ok if you can post it here inthis topic or someone help me with this batch file problem
     
  10. Mosaic1

    Mosaic1

    Joined:
    Aug 17, 2001
    Messages:
    7,486
    You didn't assign the address to a variable. Try this:

    Code:
    @echo off
    
    Set /p key=Enter Your Search Here  
    
    start "%programFiles%\internet explorer\iexplore.exe" "www.google.com/search?hl=en&q=%key%"
    
    Set /p key will wait for them to enter their search and then assign to the variable named key.

    So now you add %key% to the google and google now searches.

    I used start instead of call. That closes the command window for you without waiting for you to close the IE which is opened to search Google.
     
  11. desmin

    desmin Banned Thread Starter

    Joined:
    Jul 10, 2007
    Messages:
    57
    thx this helped alot
     
  12. dez_666

    dez_666

    Joined:
    May 29, 2007
    Messages:
    842
    you should be able to leave out the %program files%\internet explorer part and just put "iexplore". i sometimes launch IE from the run prompt by typing iexplore >_>
     
  13. Mosaic1

    Mosaic1

    Joined:
    Aug 17, 2001
    Messages:
    7,486

    True. But only if you use Start. When you use Start, it causes the command to look here in the registry for the path to iexplore.exe:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE

    This is because Iexplore.exe is not located in the usual path statement and so is not found by looking in the usual places. If you do not use Start, it won't be found.
     
  14. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/594164

  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.
    Dismiss Notice