Announcement

Collapse
No announcement yet.

scripting a url on multiple users on desktop

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • scripting a url on multiple users on desktop

    Hi Guys,

    newbie here at scripting

    i have a few 1000 users with a numeric username followed by a "s" e.g 1234s"


    in AD that i need to create a url on their desktop when they login to a link something like

    http://website:50000/itc/init.do?lan...ormat=HH:mm:ss

    where XXXX is the username minus the "s"

    any help would be greatly appreciated

    thanks

  • #2
    Re: scripting a url on multiple users on desktop

    This assumes that the last character of the username is "s" and therefore strips it. I wasn't sure if you needed the date in the url using the format in your example or if that was needed for the website. It can be added if needed.
    Finally you add this logon script to the OU that you wish to run it. Each time the user logs on the script will run and overwrite any existing shortcuts by the same name.

    Code:
    dim oShell, oUrlLink, sUsername
    
    Set oShell = WScript.CreateObject("WScript.Shell")
    sUsername = oShell.ExpandEnvironmentStrings("%Username%")
    sUsername = mid(sUsername, 1, len(sUsername) - 1)
    
    Set oUrlLink = oShell.CreateShortcut(oShell.SpecialFolders("Desktop") & "\shortcutfilename.url")
       
    oUrlLink.TargetPath = "http://website:50000/itc/init.do?lang=en&store_id=0000000000000000" & sUsername & "&dateFormat=yyyy/MM/dd&timeFormat=HH:mm:ss"
    oUrlLink.Save
    Last edited by ahinson; 24th December 2008, 06:19.
    Andrew

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: scripting a url on multiple users on desktop

      HI Andrew!

      thanks for the script its going to help a great deal

      one thing is that when the script is executed the time is out by an hour and its also 12hr time

      is there any reason for it?

      thanks again for all your help i really apreciate it

      Comment


      • #4
        Re: scripting a url on multiple users on desktop

        Originally posted by krayzie View Post
        HI Andrew!

        thanks for the script its going to help a great deal

        one thing is that when the script is executed the time is out by an hour and its also 12hr time

        is there any reason for it?

        thanks again for all your help i really apreciate it
        No problem. It's my pleasure to help. I'm not sure why the time would be off and in the wrong format. I'm guessing you're using 24hr time?

        With VBScript time format - which I don't think you're using but still might be relevant here as an example, HH:mm:ss is 24hr notation and hh:mm:ss for 12hr notation where 00:00:00 and 12:00:00 AM are midnight respectively. Where are the time and date coming from? It's not in the script so maybe from the web server?
        Last edited by ahinson; 7th January 2009, 04:20.
        Andrew

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment


        • #5
          Re: scripting a url on multiple users on desktop

          Hi Andrew,

          it is getting generated from a itimeclock.jsp from SAP

          i think i figured out what was wrong,

          i was trying to log on with an account that was created in AD but not in the SAP pilot

          all the AD accounts with SAP enabled login's come up with the correct time date format plus the extra buttons that werent appearing

          thanks so much for your help! truly greatful for your help!

          and the quick replies!

          how do i give u rep points?

          Comment


          • #6
            Re: scripting a url on multiple users on desktop

            Originally posted by krayzie View Post
            Hi Andrew,

            it is getting generated from a itimeclock.jsp from SAP

            i think i figured out what was wrong,

            i was trying to log on with an account that was created in AD but not in the SAP pilot

            all the AD accounts with SAP enabled login's come up with the correct time date format plus the extra buttons that werent appearing

            thanks so much for your help! truly greatful for your help!

            and the quick replies!

            how do i give u rep points?
            Excellent! I'm glad you figured it out.
            Last edited by ahinson; 25th February 2009, 02:17.
            Andrew

            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

            Comment

            Working...
            X