Script to check Subnet then run If Exist RRS feed

  • Question

  • Hi, I am trying to find a command or better suggestion for my current script. 

    I would like a file (RemoteApp) be copied from the server if its not on the local offices LAN and not currently on the users log in.  In a nutshell, deploying to remoteapp and I would like anyone to be able to log into a satellite office computer and have the RemoteApp file on their desktop to open a session. I cant just set it as user GP bc I do not want to confuse user at main office because they will have the application locally installed on the computer.  Any suggestions would be greatly appreciated. If there is another way to go about this, Im all ears. Thanks

    echo off
    if exist ”%USERPROFILE%\DESKTOP\FileName. rdp” goto yesfile
    if not exist ”%USERPROFILE%\DESKTOP\FileName .rdp” goto nofile
    goto end
    goto end
    copy "\\Server\ShareFolder\Filename.rdp” ”%USERPROFILE%\DESKTOP\”
    goto end

    • Moved by Bill_Stewart Wednesday, November 29, 2017 6:12 PM Unanswerable drive-by question
    Friday, October 6, 2017 9:21 PM

All replies

  • Copy the file to the "AllUser" desktop on all PCs in network.  Do not do this in a logon script.

    YOU can also create a shortcut to the file on the desktop of all users with Group Policy.


    Friday, October 6, 2017 11:07 PM
  • Thank you for the reply,

    However, I tried this method and it did not add the file to the computers desktop for test machine onsite.

    The settings for GP is

    Scope > Security Filtering to group with test computer in it.

    Delegation to Domain Users, System.

    Domain Users only have read permission.

    The script previously would copy the file but was having trouble narrowing down to specific locations in the domain.

    Monday, October 9, 2017 6:04 PM
  • No idea what you are trying to say.  If you copy a shortcut to "C:\Users\Public\Desktop" on any PC it will show on every users desktop that is logged into that PC.  Do this once to each machine that needs the shortcut.


    • Edited by jrv Monday, October 9, 2017 8:41 PM
    Monday, October 9, 2017 8:40 PM