1 Reply Latest reply on Jul 30, 2008 4:29 AM by punisher46

    Batch file works when run from sdmcache folder - but does not seem to function as a task.  I am using StartAsuser...



      The end result of the lines below should produce a shortcut on the logged on users desktop that points to a URL.






      My batch file has the following lines



      @echo off


      StartAsUser.exe COPY shortcutmaker.vbs %systemroot%\system32


      Shortcutmaker.vbs Install-published-apps http://localhost:9595/webportal/webportal.exe






      The Shortcutmaker.vbs file is a part of the additional files when this package is run.



      Shortcutmaker.vbs has the following lines:



      Set ArgObj = WScript.Arguments

      Set WshShell = CreateObject("WScript.Shell")

      strDesktopPath = WshShell.SpecialFolders("Desktop")

      urlname = ArgObj(0)

      Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\" & urlname & ".url")

      objShortcutUrl.TargetPath = ArgObj(1)







      When I run this as a task, it says it completes with no errror, but the shortcut does not appear on the users desktop.



      If I double click on the batch file in the LDclient sdmcache folder, the shortcut appears just fine.



      What am I missing?