1 Reply Latest reply on Mar 20, 2012 11:14 AM by MarXtar

    Windows 7 embedded and VB


      I'm trying to run a vb script and not having any luck.  We have Kiosks that have Windows 7 embedded that are very locked down and I need to update their software.  First I copy files to it with a batch file and that works fine through landesk. I can run the vbscript manually on the machine and it works.  It is just when I try to push it through Landesk.  Has anyone tried running a vbscript on Windows 7 embedded?


      I have tried adding the vbscript the batch file and recieve either an "access denied" or "Sdclient.exe or the installation program was terminated at the client"  I have added an account on the Kiosk with proper rights.


      If I try to create a Windows Script Host packages I get an exit code of 3 and the package fails.  The batch file is below.  NOTE: I added del to the batch file and remarked out the delete in the vb script. The vbscript was failing if those shortcuts didn't exist(after I had already ran it) so it does seem to be doing some of the script. After it reboots the new software should startup and it is not. 


      bcdedit.exe -set loadoptions DDISABLE_INTEGRITY_CHECKS


      bcdedit.exe -set TESTSIGNING ON


      xcopy  "c:\program files\landesk\ldclient\sdmcache\packages\Handson_kiosk\hok-to-pcc\iespawner" c:\POC-Setup\iespawner /D /E /C /R /I /K /Y


      mkdir "C:\windows\system32\grouppolicy\user"


      xcopy "c:\program files\landesk\ldclient\sdmcache\packages\Handson_kiosk\hok-to-pcc\registry.pol" c:\Windows\System32\GroupPolicy\User /D /E /C /R /I /K /Y


      @echo off
      cd "c:\ProgramData\microsoft\windows\start menu\programs\startup"
      del Desktop.lnk


      @echo off
      cd "C:\Users\Administrator\Desktop"
      del "Hands On.lnk"


      @echo off
      cd "D:\Program Files\Good Samaritan Society\HandsOnKioskInstaller\Data"
      del handson.sdf


      ewfmgr c: -commit


      wscript c:\program files\landesk\ldclient\sdmcache\packages\handson_Kiosk\hok-to-pcc\shortcuts3.vbs






      The vbscirpt


      ' Create Internet Explorer shortcut in the Start Menu folder


      Set oShell = CreateObject("WScript.Shell")


      sStartMenuPath = "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"


      sWinSysDir = oShell.ExpandEnvironmentStrings("%SystemRoot%\System32")


      Set oShortCut = oShell.CreateShortcut( _
               sStartMenuPath & "\iexplore.lnk")


      oShortCut.TargetPath = "c:\Program Files\Internet Explorer\iexplore.exe"


      oShortCut.WorkingDirectory = "c:\Program Files\Internet Explorer"




      ' Create iespawner shortcut in the Start Menu folder


      Set oShortCut1 = oShell.CreateShortcut( _
               sStartMenuPath & "\iespawner.lnk")


      oShortCut1.TargetPath = "c:\POC-SETUP\iespawner\IESpawner.exe"


      oShortCut1.WorkingDirectory = "c:\POC-SETUP\iespawner"




      ' Delete Hands On From Startup Folder


      'Set obj = CreateObject("Scripting.FileSystemObject")
      'obj.DeleteFile("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Desktop.lnk")


      ' Delete Hands On shortcut from Desktop


      'obj.DeleteFile("C:\Users\Administrator\Desktop\Hands On.lnk")


      ' Delete Hands On database - Fix
      'obj.DeleteFile("D:\Program Files\Good Samaritan Society\HandsOnKioskInstaller\Data\handson.sdf")


      'Group Policy Update
      Set WshShell = CreateObject("Wscript.Shell")
      WshShell.Run "c:\Windows\System32\gpupdate.exe /force"


      ' Install Careworx Theme


      Set WshShell = CreateObject("Wscript.Shell")
      WshShell.Run "c:\Users\Administrator\AppData\Local\Microsoft\Windows\Themes\oem.theme"


      seconds = 10
      elapsed = TimeSerial(0,0,seconds)
      startTime = Time()
      endTime = TimeValue(startTime) + TimeValue(elapsed)
      While endTime > Time ()


      ' Set DPI to 120


      Const HKEY_CURRENT_USER = &H80000001


      strComputer = "."

      Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

      strKeyPath = "Control Panel\Desktop"
      strValueName = "LogPixels"
      dwValue = 120


      objRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue


      ' Set default IE home page


      strKeyPath = "Software\Microsoft\Internet Explorer\Main"
      strValueName = "Start Page"
      strValue = "http://www.pointclickcare.us/poc/userLogin.xhtml"


      objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue


      ' Remove Hot Virtual Keyboard From Startup

      Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

      strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Run"
      strValueName = "hvk"

      oReg.DeleteValue HKEY_CURRENT_USER,strKeyPath,strValueName


      'Commit Changes
      Set WshShell = CreateObject("Wscript.Shell")
      WshShell.Run "c:\Windows\System32\ewfmgr.exe c: -commit"


      Set WshShell = CreateObject("Wscript.Shell")
      WshShell.Run "c:\Windows\System32\shutdown.exe -r -t 10"


      Any suggestions?  If anyone needs more info, please let me know