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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script works on XP machine but not on Win7 Pro

Status
Not open for further replies.

BigC72

MIS
Oct 15, 2004
69
US
I have the following script that has been in place and working for sometime now on literally hundreds of our XP Pro machines:

Code:
CONST SHOW_ACTIVE_APP = 1
Set shell = createobject("Wscript.Shell")

Dim X
Dim Y
Dim strArgValue
Dim tabValue

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'imagenow.exe'")

If colProcesses.Count = 0 Then

	MsgBox "Please take a moment to log into ImageNow and then try your search again", 48, "ATTENTION: Login Required"
    shell.run ("""C:\Program Files\ImageNow6\bin\imagenow.exe"""), SHOW_ACTIVE_APP, True
		
					
Else 

		Set imagenowAPI = GetObject( , "imagenow6.CtrlPanel")
		Set objArgs = WScript.Arguments

		' Configure request parameters
		Set viewRequest = imagenowAPI.INCreateViewRequest()
		strArgValue = objArgs(0)
		tabValue = ("'" & strArgValue & "'")

		X = viewRequest.SetViewName("All Documents", "Document")

		'This is where you'll insert the patient account number
		Y = viewRequest.SetVSLFilterText("[Tab] = " & tabValue)

		' Now, let's open up the view in the full client
		viewRequest.OpenInClient()

				
end if

We're preparing to roll out some new Win7 Pro laptops and this script is needed there as well but when I attempt to run it on the Win7 machine I get the following:

link_error.png


Hoping someone can point me to what I'm missing on the Win7 machines to get this working properly..

Thank you...
 
The one I'm working with now is 32 bit but eventually I'll also have to deal with 64 bit machines as well...
 
And your domain controller is Server 2003 or Server 2008?
 
I'm just guessing but I think it has something to do with a path setting in an environment variable. Look at the environment on an XP and compare it to the Win7.

 
Probably a permissions issue. Under Vista and Win7, even if you are logged in under an ID that's a local admin, you are not the administrator - there are still some limitations.

Try right-clicking the script and choosing "Run as administrator". If that works, this solution might work:

If you don't have the "run as" choice,this might help:

Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top