Solved

Cannot get WshShell.run to work on Windows7 64-bit OS

Posted on 2014-10-08
5
831 Views
Last Modified: 2014-10-13
The following code works fine on Windows 7  32-bit computer but does not work on W7 64-bit box. Nothing happens when I click on the winres.exe icon.

sub resume1_onclick()

          Dim WshSHell
          Set WshShell = CreateObject("Wscript.Shell")
          WshSHell.run "Winres.exe",1,false
                     
       end sub
0
Comment
Question by:megnin
5 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 40370128
did you install the  .NET Framework SDK  (it is part of the full sdk)
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 40370147
My guess is the system doesn't know where to find the exe. Try specifying a full path and if that works make the script determine where it should find it based on the bitness.

Rob.
0
 
LVL 37

Accepted Solution

by:
Gerwin Jansen earned 500 total points
ID: 40370306
Save this as a .vbs file and double click it:

          Dim WshSHell
          Set WshShell = CreateObject("Wscript.Shell")
          WshSHell.run "Notepad.exe",1,false

Is notepad launched? If so: change Winres.exe to: c:\somepath\Winres.exe

Your Winres.exe is not in the PATH - that's why it is not starting.
0
 
LVL 1

Author Closing Comment

by:megnin
ID: 40377162
Thank you so much, Gerwin.  Sorry for the late reply.  I was out sick.  There was a *.lnk file pointing to an executable in a different path.  Thank!
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 40377246
No problem at all :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now