Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateObject and Win7

Status
Not open for further replies.

atxstl

Programmer
Jul 15, 2010
1
0
0
US
Hi, I'm trying to execute the following line of code. It was compiled on XP, and works on XP, but does not work on Windows 7

Code:
    Dim shell
    Set shell = CreateObject("wscript.shell")
    shell.run "myfile.bat"
    Set shell = Nothing

Any advice? Thanks.
 
Your code is running for me under Vista when I substitute 'myfile.bat' with 'notepad.exe'.

Personally I would not dim shell because Shell clashes with the name of a built-in VB6 Function, have you tried diming it with a different name.

Are you getting any error message.
 
I wonder if the program is in the Programs folder?

It might be a file virtualization side effect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top