Dear great experts:
I run the following script:
cmd /c powershell.exe -WindowStyle Hidden -NonInteractive -command {$hklm = "HKEY_LOCAL_MACHINE" ;$key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireless-101_is1" ;$value = "InstallLocation" ;$a=([Microsoft.Win32.Registry]::GetValue("$hklm\$key",$value,$null) + 'bin\App.exe') ;& $a}。
The function of this script is to query the registry and then run the application in the installation path.
Now the problem is: If it is run in PowerShell under Win7, after entering the PowerShell interface, running this script is OK, and the application can be called correctly.
But: If it is run in cmd in Win7, entering the normal command line interface, running this script has problems.
If in the cmd interface, run the cmd /c powershell command once first, and then run this script, there is no problem.
Hope that great experts can give advice!
I run the following script:
cmd /c powershell.exe -WindowStyle Hidden -NonInteractive -command {$hklm = "HKEY_LOCAL_MACHINE" ;$key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Wireless-101_is1" ;$value = "InstallLocation" ;$a=([Microsoft.Win32.Registry]::GetValue("$hklm\$key",$value,$null) + 'bin\App.exe') ;& $a}。
The function of this script is to query the registry and then run the application in the installation path.
Now the problem is: If it is run in PowerShell under Win7, after entering the PowerShell interface, running this script is OK, and the application can be called correctly.
But: If it is run in cmd in Win7, entering the normal command line interface, running this script has problems.
If in the cmd interface, run the cmd /c powershell command once first, and then run this script, there is no problem.
Hope that great experts can give advice!
