none
Why Does This VB Script Work in Windows 7 But Not Windows 10? RRS feed

  • General discussion

  • When I run this script in Windows 7, I get 2 folders on the desktop that can immediately access their respective repositories as expected.

    Set objShell=Wscript.CreateObject("Wscript.shell")
    strDesktopFolder=objShell.SpecialFolders("Desktop") & "\"
    'create privateftp folder on desktop
    Set objShortcut=objShell.CreateShortcut(strDesktopFolder & "PrivateFTP.lnk")
    objShortCut.TargetPath = "ftp://Privateftp+mycompanyname.com:Password@privateftp.mycompanyname.com"
    objShortCut.Description = "PrivateFTP"
    objShortCut.Save
    'create businessftp folder on desktop
    Set objShortcut=objShell.CreateShortcut(strDesktopFolder & "BusinessFTP.lnk")
    objShortCut.TargetPath = "ftp://username2+mycompanyname.com:P+ssword2@businessftp.mycompanyname.com"
    objShortCut.Description = "BusinessFTP"
    objShortCut.Save

    However, when I run the same script in Windows 10, I get the same folders on the desktop but when attempting to open them, the ftp credential window appears with Privateftp+mycompanyname.com as the User name, blank password text box, and a message at the top that says "Could not log into the FTP server with the username and password specified."




    • Edited by CharlieWork Tuesday, July 2, 2019 5:43 PM
    • Changed type Bill_Stewart Thursday, September 5, 2019 9:38 PM
    • Moved by Bill_Stewart Thursday, September 5, 2019 9:38 PM Break/fix problem on end user's machine
    Tuesday, July 2, 2019 5:24 PM

All replies

  • Set objShell=Wscript.CreateObject("Wscript.shell")
    strDesktopFolder=objShell.SpecialFolders("Desktop") & "\"
    'create privateftp folder on desktop
    Set objShortcut=objShell.CreateShortcut(strDesktopFolder & "PrivateFTP.lnk")
    objShortCut.TargetPath = "ftp://Privateftp+mycompanyname.com:Password@privateftp.mycompanyname.com"
    objShortCut.Description = "PrivateFTP"
    objShortCut.Save
    'create businessftp folder on desktop
    Set objShortcut=objShell.CreateShortcut(strDesktopFolder & "BusinessFTP.lnk")
    objShortCut.TargetPath = "ftp://username2+mycompanyname.com:P+ssword2@businessftp.mycompanyname.com"
    objShortCut.Description = "BusinessFTP"
    objShortCut.Save

    Tuesday, July 2, 2019 5:47 PM
  • It is definitely not recommended to hard-code passwords into shortcuts or scripts.

    There are other ways to safely manage credentials.


    -- Bill Stewart [Bill_Stewart]

    Tuesday, July 2, 2019 6:04 PM
  • I agree, however, I'm trying to determine why those .vbs commands fail to function the same in Windows 10.
    Wednesday, July 3, 2019 5:23 PM
  • The "shell" was changed in W10.  Many things have been dropped and many have been altered.

    The best place to resolve this is in a Windows 10 Shell developer forum.


    \_(ツ)_/

    Wednesday, July 3, 2019 5:45 PM
  • Windows 10 no longer allows the userid:password method from IE or Edge.  Most browser will not allow this today as it is a security risk.


    \_(ツ)_/

    Wednesday, July 3, 2019 6:00 PM
  • Try allowing the shell FTP access through the firewall.  It is blocked by default in W10.


    \_(ツ)_/


    • Edited by jrv Wednesday, July 3, 2019 6:12 PM
    Wednesday, July 3, 2019 6:10 PM