locked
Copy file via a batch RRS feed

  • Question

  • I have a group policy and I want to add a logon script to it so that I can copy the iexplore.exe from the local drive of a persons computer to a share. This share is a redirection of the users desktop. This is how I have it written now and it is copying the file to the desktop, but when you try and run the iexplore.exe from the users desktop it shows up in Task Manager, but then quits. I was not sure if it is copying the file from the server or its local drive.

     

    xcopy "c:\program files\internet explorer\iexplore.exe" \\skynet\desktops\%username%\desktop

    rename \\skynet\desktops\%username%\desktop\iexplore.exe "Internet Explorer.exe"

     

    Thanks!

    Monday, January 17, 2011 4:17 PM

Answers

All replies

  • I think that what you are trying to achive is to create a shorcut (link) to internet explorer. If this is the case you should not copy the exe file, instead you should create a shortcut to iexplore.exe and place it in All Users\Desktop folder on users computer. Or just copy the shortcut to %username%\desktop folder
    With kind regards
    Krystian Zieja
    http://www.projectnenvision.com
    Follow me on twitter
    My Blog
    Monday, January 17, 2011 4:30 PM
  • Simply copying iexplorer.exe to the desktop won't install it, and that copy of it won't be in the correct path on the system to run properly, so as Krystian says you want to use a shortcut instead. You could either use a login script like you tried already, or alternatively if you're using Windows 2008 you could use Group Policy Preferences to configure the shortcut instead. http://social.technet.microsoft.com/Forums/en/winserverGP/thread/02a7bfbb-180f-40eb-82e3-2343b2bf31eb
    Monday, January 17, 2011 8:51 PM
  • Yes I want to use a logon script. Can you give me some assistance as to how I would write that? Not sure how to tell a logon script how to create a shortcut.
    Monday, January 17, 2011 9:07 PM
  • Hmm... You are on a group policy forum asking how to write a logon script.... Logo scripts are hated by Group Policy professionsl in fact you could say http://ihatelogonscripts.com

    What i recommend is that you use the Group Policy Preferece shortcut extention (see http://technet.microsoft.com/en-us/library/cc730592.aspx ) and create the shortcut that way. The advantage of this are:

    1. You dont need to use a logon script

    2. The shortcut will update while the user is logged on so you will not need to get them to reboot to run the script

    3. Group Policy Preferences are far easier to troubleshoot and maintain as there is no script coding/debuging required to maintain it.

    If you have not used Group Policy Preference yet then take a look at my article Group Policy Preferences Prerequisites

    Hope this helps

     


    Alan Burchill (MVP)
    http://www.grouppolicy.biz
    Monday, January 17, 2011 9:29 PM
  • Smica,

    Do the following : create the shortcut with all the configurations you want (should be a .url file; i.e yourfile.url).

    Put the file in the %logonserver%\netlogon share folder.

    Create a .bat file with the following commands :

    if not exist (%allusersprofile%\desktop\yourfile.url) = 1
     copy %logonserver%\netlogon\yourfile.url %allusersprofile%\desktop\*.*
    endif

    Save the file as icon.bat and that's it. The script checks if the .url is present in the %AllUsersProfile%\Desktop and if not, it copies it to that place.

    How to set a logon script I think you already know.

     

    Monday, January 17, 2011 9:38 PM
  • Hi,

     

    I agree that GPP is a good and easy way to manage shortcuts.

     

    If you do not have Windows Server 2008 or Windows Server 2008 R2 installed, you can also configure a Group Policy preference item in a Windows Server 2003 environment from either a Windows Server 2008/R2 server or a Windows Vista with Service Pack 1/Windows 7 client with RSAT update installed. You can download and install Remote Server Administration Tools on a Windows Vista or Windows 7 client to manage and configure them.

    Microsoft Remote Server Administration Tools for Windows Vista 
    http://www.microsoft.com/downloads/details.aspx?FamilyId=9FF6E897-23CE-4A36-B7FC-D52065DE9960&displaylang=en


    Remote Server Administration Tools for Windows 7 

    http://www.microsoft.com/downloads/details.aspx?FamilyID=7D2F6AD7-656B-4313-A005-4E344E43997D&displaylang=en

    The CSEs for the new Group Policy preference functionality are required in Windows XP Service Pack 2 (SP2), Windows Server 2003 Service Pack 1 (SP1), and Windows Vista to process the new preference items. To download and install CSEs, please refer to the following link:

     

    Information about new Group Policy preferences in Windows Server 2008

    http://support.microsoft.com/kb/943729

     

    If you still want to achieve this goal via scripts, please check if the following Microsoft KB article is helpful for you.

     

    How to create a desktop shortcut with the Windows Script Host

    http://support.microsoft.com/kb/244677

     

    If you encounter any difficulties when customizing the scripts, you may submit a new question in The Official Scripting Guys Forum! which is a best resource for scripting related issues.

     

    The Official Scripting Guys Forum!

    http://social.technet.microsoft.com/Forums/en/ITCG/threads

     

    Regards,

     

    Arthur Li

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, January 18, 2011 2:22 AM
  • Alan,

     

    I now see what you are talking about. I think I am going to use my 2008 r2 server to accomplish this. Can you give me a example of what I enter in the GP Pref Fields to do a shortcut for IE to be placed on a users desktop? I would also like for IE to open to a specific website if that is possible as well.

     

    Action: Update, Create, Replace, Delete

    Name:

    Target Type: File System Object, URL, Shell Object

    Location:

    Target Path:

    Argument:

    Start in:

    Shortcut Key:

    Run:

    Comment:

    Icon File Path:

    One other note I would like this to use internet explorer to open the site in. Not our default web browser which is Google Chrome.

     

     

    Tuesday, January 18, 2011 1:46 PM
  • Hi,

     

    For the detailed information regarding how to configure a shortcut item, please refer to the following Microsoft TechNet article:

     

    Configure a Shortcut Item

    http://technet.microsoft.com/en-us/library/cc753580.aspx

     

    Regards,

     

    Arthur Li

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

     

    Tuesday, January 25, 2011 6:58 AM
  • Hi,

     

    I would like to confirm what is the current situation? If there is anything that I can do for you, please do not hesitate to let me know, and I will be happy to help.

     

    Regards,

     

    Arthur Li

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, January 27, 2011 2:07 AM
  • Arthur,

    I am going to try the link you provided last week and see what I can come up with. I am sure I will have further questions so I will get back to you soon.

     

     

    Thanks

    -Scott

    Monday, January 31, 2011 3:12 PM
  • Arthur_Li,

     

    I am running into problems trying to figure out how to make a Shortcut that I created on the desktop to open a website and also use Internet Explorer to do this. We made a switch to Google Chrome as our Default Browser so this shortcut in which I created through the Group Policy want to open using Google Chrome. Anyway to make this GP use IE instead but still leave Google Chrome as the default browser?

     

    Thanks

    Wednesday, February 2, 2011 12:31 PM
  • Hi,

     

    Please also create the following Group Policy Preferences:

     

    User Configuration\Preferences\Control Panel Settings\Folder Options\Open With

     

    Action: Update

    File Extension: .url

    Associated Program: C:\Program Files\Internet Explorer\iexplore.exe

     

    Regards,

     

    Arthur Li

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, February 3, 2011 1:56 AM