Solved

script compatibility layer windows 7

Posted on 2010-11-13
4
3,002 Views
Last Modified: 2012-06-27
script compatibility layer windows 7
I have some old Programs that will not run in a compatibility layer  on windows 7
through a script. They work fine in Windows XP. Tempted to downgrade to XP Again, But Hope one of you has a solution.
If I copy them to a local directory and change the path in the scripts to the local one
Same Problem
However If I right click select Properties and set from there, they work fine. But can't do this if the exe is located on a network drive.

Has anybody had this problem, seems that __COMPAT_LAYER does not work from a script in Windows 7.

This is the old Script
Set WshShell = WScript.CreateObject("WScript.Shell")
Set wshProcEnv = wshShell.Environment("PROCESS")  
wshProcEnv("__COMPAT_LAYER") = "Win98"
WshShell.run "H:\Stories\Whales1\Whales1.exe

or
@echo off
Title A Whale of a Tale
set __COMPAT_LAYER=256Color
set __COMPAT_LAYER=Win98
H:\Stories\Whales1\Whales1.exe
set __COMPAT_LAYER=
exit
0
Comment
Question by:neviller2
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:Tolomir
ID: 34131010
windows 7 professional (enterprise / ultimate) comes with the virtual xp mode. This is a complete isolated windows xp virtual machine.

You could run your script within the virtual machine. Virtual XPMode allows full access to all files (depending on permissions) of the windows 7 host system.

http://www.microsoft.com/windows/virtual-pc/download.aspx

Tolomir
0
 
LVL 27

Accepted Solution

by:
Tolomir earned 500 total points
ID: 34131022
Btw. have you tried already:

wshProcEnv("__COMPAT_LAYER") = "WinXPSp3"

Open in new window

0
 
LVL 1

Author Comment

by:neviller2
ID: 34131515
Thanks Tolomir, for your help.
It was the test machine I had setup.
The Script now works.
Sometimes the easiest solution is the hardest to find.

Virtual machine might be an option in the future, Will look into that.
Thanks.
0
 
LVL 1

Author Closing Comment

by:neviller2
ID: 34131529
Turned out to be my test Machine. Will check reason why test machine failed later.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I recently purchased an HP EliteBook 2540p notebook/laptop. It has two video ports on it – VGA and DisplayPort. HP offers an optional docking station for the 2540p that also has both a VGA port and a DisplayPort. There are numerous online reports do…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

757 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

18 Experts available now in Live!

Get 1:1 Help Now