DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 12 of 12

Thread: Shorcut Error

  1. #1
    Join Date
    Jul 2010
    Posts
    7

    Shorcut Error

    Hi guys

    First post here. Hoping you can help.

    I have a simple VB script on all of my client networks to put a shortcut to my company website on their desktop.

    The script in general works fine.

    Some users (Ive not found anything related between the users having the error) seem to get an error each time they login and the script is run.

    Below is the script:

    Code:
    'CreateSC.vbs
    Dim objShell:Set objShell=CreateObject("Wscript.Shell")
    strDesktop = objShell.SpecialFolders("Desktop")
    Dim objSC: Set objSC=objShell.CreateShortCut(strDesktop & "\Prime Networks Support.lnk")
    With objSC
      .WorkingDirectory="http://www.prime-networks.co.uk/support"
      .TargetPath="http://www.prime-networks.co.uk/support"
      .IconLocation ="\\LPT-SBS-2K8\sysvol\lptrading.local\scripts\prime.ico"
      .Save
    End With
    Set objSC=Nothing
    Set objShell=Nothing
    The error is the users are getting is this:

    Script: \\LPT-SBS-2K8\sysvol\lptrading.local\scripts\Prime Shortcut.vbs
    Line: 9
    Char:3
    Error: Unable to save shortcut "C:\documents and settings\JD.lptrading\Desktop\prime Networks support.ink"
    Code: 800704C8
    Source WshShortcut.Save


    Any help on this appreciated.

    Regards

    Ben
    Last edited by ben_weinberg; 07-09-2010 at 12:03 PM.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    My guess would be some users do have the proper permissions set to support saving this link file.

  3. #3
    Join Date
    Jul 2010
    Posts
    7
    Sorry, I should have mentioned. All users have local admin rights to their PC's.

    That was my first thought.

    I checked the shortcut on a users desktop who was getting the error, but he had full read/write/append privileges.

    any other thoughts?

    Thanks for the reply.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    If you sit down at one of these machines, with the user logged in, can you create this shortcut manually?

  5. #5
    Join Date
    Jul 2010
    Posts
    7
    Yes.

  6. #6
    Join Date
    Jul 2010
    Posts
    7
    Although they get the error, the shortcut is created. The problem is not with it not working, It works. The problem is the error each time a user logs in.

    Thanks again for the reply.

  7. #7
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    The error is from the .Save method (that actually saves the shortcut to disk, after it was created), and the description for the error code 800704C8 is:

    The requested operation cannot be performed on a file with a user-mapped section open.

    See if that can help you. If you google for "800704C8 mapped" (with no quote) you can see that you are not alone :-) It is a very generic problem, so there is no generic solution, it depends on the context.

    Good luck.
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  8. #8
    Join Date
    Jul 2010
    Posts
    2

    Smile version of WSH?

    It works fine on my Win7 PC with WSH 5.8 installed...hope that helps.

  9. #9
    Join Date
    Jul 2010
    Posts
    7
    we have 250 machines that it works on. 10 that it doesnt. These 10 machines are all on different domains, and they are all as up to date as all the other 250 machines. I cant find anything similar that would cause this!

    Thanks for letting me know though! What is WSH, and how do i check its version??

  10. #10
    Join Date
    Jul 2010
    Posts
    7
    Ah Windows Script host... how do i find the version?

  11. #11
    Join Date
    Jul 2010
    Posts
    2

    Smile WSH version

    It should display in the command prompt window when you run a script.

  12. #12
    Join Date
    Jul 2010
    Posts
    7
    Ok so he has windows XP WSH Version 5.7

    Bare in mind this script runs during login. I have just noted that when i run it from a command prompt after the user has logged in all works fine with no errors??

Similar Threads

  1. Replies: 2
    Last Post: 05-14-2009, 09:22 AM
  2. Replies: 5
    Last Post: 01-17-2007, 02:37 PM
  3. 'On Error Goto' versus 'Try, Catch, Fail'
    By clarence_rollins in forum .NET
    Replies: 21
    Last Post: 09-11-2002, 11:32 AM
  4. Returning errors from SQL Server Stored Procs
    By Khalizan in forum VB Classic
    Replies: 1
    Last Post: 11-28-2001, 02:32 AM
  5. Replies: 0
    Last Post: 04-07-2000, 09:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center