+ Reply to Thread
Results 1 to 15 of 15

Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

Hybrid View

  1. #1
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Exclamation Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    Hello Excellers!

    i just created an excel file that runs CMD to start a telnet session and send some commands to a Cisco switch.
    my file works perfectly as charm on my win7-32bits / win 10-64bits machines but it doesn't at win 7-64bits !!
    the first command line intended to be typed on the cmd window is "telnet 10.212.45.50"
    it fails with the following error "'Telnet' is not recognized as an internal or external command" knowing that TELNET is well installed since i can run it from a CMD window i open myself.

    any help,hints or suggestions would be so appreciated.

    Thanks

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    You'd probably need to turn Windows features on.

    Go to Control Panel -> Programs -> Programs and Features: Turn Windows features on or off.

    Find "Telnet Client" and check.

    Telnet.JPG

  3. #3
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    thanks CK76, its already checked but still the same
    fyi: i can run telnet from a cmd windows but MSexcel can't !!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    I'm not sure I understand you... can you post the code you are using in Excel VBA that's giving issue?
    I'm guessing you are using Shell function to run command line from VBA...

    Edit: Also check your environmental path. As well as check path of cmd.exe
    (it may be that SysWOW64\cmd.exe is run instead of System32\cmd.exe) Telnet will only work when run from System32\cmd.exe
    Last edited by CK76; 01-09-2017 at 01:55 PM. Reason: See Edit:

  5. #5
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    i honestly can't tellthe difference between the SysWOW64\cmd.exe and System32\cmd.exe...Anyway here is the code i am using:
    Dim data As Range
    Dim voi As Range

    ' The variables data & voi contains the cells that will
    ' cause an alert when they are right clicked.
    Set data = Range("J2:J25,V2:V25,AG2:AG25")
    If Not Application.Intersect(data, Range(Target.Address)) _
    Is Nothing Then
    t = Shell("cmd.exe", vbNormalFocus)
    Application.Wait Time + TimeSerial(0, 0, 2)
    SendKeys "telnet 10.220.44."
    SendKeys Range((Target.Address)).Offset(0, -1)
    SendKeys "{ENTER}"
    Application.Wait Time + TimeSerial(0, 0, 2)
    SendKeys "user1{ENTER}"
    SendKeys ("PASS11")
    Application.Wait Time + TimeSerial(0, 0, 1)
    SendKeys "conf t{ENTER}int fa0/"
    SendKeys Range((Target.Address)).Offset(0, -2)
    SendKeys "{ENTER}"
    SendKeys "sw acc vl "
    SendKeys Target.Value
    SendKeys "{ENTER}sh{ENTER}no sh{ENTER}"
    SendKeys "end{ENTER}wr{ENTER}exit"
    Application.Wait Time + TimeSerial(0, 0, 1)
    SendKeys "{NUMLOCK}", True
    MsgBox "DONE"
    End If
    End Sub

    edit:> see attachment.
    Attached Images Attached Images
    Last edited by nkiine; 01-10-2017 at 06:10 AM.

  6. #6
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    Ok, so that's not issue with VBA side and not SysWOW64 issue from what I can see.

    As I stated in previous post, check PATH environment variable (you should define installation directory of telnet).
    Or you can specify full path to telnet.exe in the arguments to run it.

  7. #7
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    @ck76 : i appreciate your answers
    i ve already checked the PATH environment variable and telnet is already there, it a weird no-sens probleme.
    when i list the content of the system32 folder via the CMD window opened by excel shell (dir c:\windows\system32\*.exe) i notice that Telnet.exe doesn't appear while it appears when i execute the same command on a CMD i opened myself. :'(
    i can send you the file and check it yourself if necessary

  8. #8
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    Sorry, don't think I can help you further if you tried all my suggested fixes. Personally, I don't use Windows Telnet. But PuTTY and other tools for Telnet connection.

  9. #9
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    Thank you CK76,
    how can i make this thread reach more people ?
    can you please invite someone else to the thread ?
    i appreciate your help and your precious time

  10. #10
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,973

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    You'd have better luck asking in Windows and/or Microsoft tech forums. As this isn't issue with VBA code.

  11. #11
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    i will, thank you once again

  12. #12
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    Hi nkiine,

    I think CK76 had the right answer with
    ... Or you can specify full path to telnet.exe in the arguments to run it.
    I suggest you find telnet.exe on the machine that fails, and put a copy in 'C:\Windows\System32'.

    Lewis
    Last edited by LJMetzger; 01-11-2017 at 11:27 AM.

  13. #13
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    hi LJMetzger,
    i ve tried this suggestion but it says ''fichier introuvable'' / "file not found"
    i copied telnet.exe from system32 folder to "c:\" > the telnet comes up but incomplete... maybe there is another dll file or some other files that needs to be placed next the telnet.exe file

  14. #14
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    my file works perfectly as charm on my win7-32bits / win 10-64bits machines but it doesn't at win 7-64bits !!
    You are not the only person who has had this problem. See
    http://superuser.com/questions/60533...t-in-windows-7
    https://answers.microsoft.com/en-us/...1-78666e29ee94

    One possible solution is to copy the telnet.exe from your win7-32bits machine to C:\Windows\System32 on the win 7-64bits machine. When invoking telnet, if you get the 'cannot be found error' try running C:\Windows\System32\telnet.exe

    I hope this helps.

    Lewis

  15. #15
    Registered User
    Join Date
    12-16-2016
    Location
    morocco
    MS-Off Ver
    2016
    Posts
    10

    Re: Excel can't run an existing specific EXE file on system32 folder !! HELP PLZ

    Hello LJ,
    the problem is solved for me.
    The issue was due to my Excel 32 bits installed on a 64Bits OS. so when I installed a new 64Bits office pack I can call telnet from excel easily with no problem

    best Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Extract specific cells from multiple excel files in same folder to new summary file
    By Derek Holden in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2014, 01:43 AM
  2. Import TXT files from a specific folder into Excel - TXT file names change hourly
    By jeepinjeff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2013, 04:08 AM
  3. Search a word file in a specific folder and copy text to excel
    By corinereyes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-02-2012, 08:15 AM
  4. Macro for copying specific data from excel files in a folder to a newly created excel file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2012, 02:24 PM
  5. Finding a specific Excel file Name from a folder through VBA
    By daksh1981 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2010, 06:56 AM
  6. Opening specific file or folder from Excel
    By goranm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2010, 08:53 AM
  7. searching folder for existing file
    By TedH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2009, 05:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1