Files.copy() method does not copy every file attribute - any suggestions???

Hi,
I am using Files.copy() method to copy a file. The exact code is:
Files.copy(sourcePath, targetPath, StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING);
However, it won't copy the UAC attributes on Windows. If I create a file with elevated access on Windows, the created files cannot be deleted/modified in Java with an non-elevated session for the same user account. I want to copy a file so that the elevation attributes get copied as well but the above code does not do that.
Thanks.
Imran.

Resolved!
I used the following script and it worked like a charm.
On Error Resume Next
'DECLARE VARIABLES HERE
Dim fso
Dim oFolder1, objFolder, oFolder
Dim path
Dim WSHShell
Dim colFolders
Dim sDocsAndSettings
Dim strComputer
strComputer = "."
Set WSHShell = CreateObject("WScript.Shell")
Set fso = createobject("Scripting.FileSystemObject")
'SPECIFY THE PATH OF THE FOLDER IN WHICH SOURCE FILES RESIDE
oFolder1 = fso.GetParentFolderName(WScript.ScriptFullName)
If Right(oFolder1, 1) <> "\Macromedia" Then oFolder1 = oFolder1 & "\Macromedia"
'COPY FILES TO USER PROFILES
sDocsAndSettings = "C:\Users\"  
Set colFolders = fso.GetFolder(sDocsAndSettings)
For Each oFolder In colFolders.SubFolders
 Select Case LCase(oFolder.Name)
  Case "admin", "administrator", "newuser", "all users", "default user", "default user.original", "localservice", "networkservice"
   'LEAVE THE DEFAULT PROFILES ON THE MACHINE
  Case Else
   ' Check for the path
   If fso.FolderExists(sDocsAndSettings & oFolder.Name & "\AppData\Roaming") Then
    'COPY FOLDER TO USER PROFILE
    fso.CopyFolder oFolder1, sDocsAndSettings & oFolder.Name & "\AppData\Roaming\" ,True
    'MsgBox "Copied  to: " & sDocsAndSettings & oFolder.Name & "\AppData\Roaming"
   End If
 End Select
Next
Set fso = Nothing
Set WSHShell = Nothing
Thanks, Souvik.

Similar Messages

  • My camera does not work on my macbook, any suggestions to fix it?

    my camera does not work on my macbook, any suggestions to fix it?

    Here are Applle's troubleshooting steps....
    support.apple.com/kb/HT2090

  • HT1918 I have 2 Apple ID's, how do I delete the old one as its interferring with my new account and the music I have already purchased through ITunes does not want to play.  Any suggestions?

    I have 2 Apple ID's, how do I delete the old one as its interferring with my new account and the music I have already purchased through ITunes does not want to play.  Any suggestions?

    Why would you create a new account?
    All purchases will be tied to the account from which they were purchased.
    You will have to authorize your computer for all the accounts from which music is purchased.

  • I have an ipad 2, ios7 will not download. I keep getting an error message that just tells me ios wont install, however it does not tell me why. Any suggestions? Thanks

    I have an ipad 2, ios7 will not download. I keep getting an error message that just tells me ios wont install, however it does not tell me why. Any suggestions? Thanks

    I find the Air easier to work with if I need a keyboard if, for no other reason, that's more compact to carry around than the iPad and a keyboard, even one that is part of an iPad case.  I also often have to access data from one application when using another, and iOS is not at its best when having to do rapid application switching (Command-Tab switching is a lot faster than the double press home, scroll the icons at the bottom and swap).
    As well, for editing I find the lack of sandboxing on OSX allows for efficiency enhancing utilities across applications, something you don't get in iOS.  I understand the reason for that, but while more secure it also creates issues of its own in terms of usability in a number of situations.
    I prefer the iPad for totally single application focused situations where little or no input is required.  I use my iPad to hold copies of manuals when I'm doing a full day continuing education presentation for CPAs.  A MacBook Aire can't really fill in very easily for that usage.
    I see them each as tools appropriate for different jobs.

  • HT1349 Problem: my iPhone 4S (1yr old) has started buzzing for no apparent reason. I cannot stop it or turn the thing off. The screen is black and does not respond to touch. Any suggestions?

    Problem: my iPhone 4S (1yr old) has started buzzing for no apparent reason. I cannot stop it or turn the thing off. The screen is black and does not respond to touch. Any suggestions?

    Thanks, AM_Kidd, I had tried that before but I tried again and this time it WORKED!!!!
    The buzzing stopped and I have the home screen up again.
    Phew! It may be that it had been on charge for the last 30 mins.
    Whatever. Again, many thanks.

  • Comcast just replaced my cable modem/wireless router.  All devices connect properly except my iPhone 4.  It shows itself to be connected to the network, but it does not load any web page.  Resetting the iPhone does not solve the problem.  Any suggestions?

    Comcast just replaced my cable modem/wireless router.  All devices connect properly except my iPhone 4.  It shows itself to be connected to the network, but it does not load any web page.  Resetting the iPhone does not solve the problem.  Any suggestions?

    Thank you for your response.
    I had rebooted the router (several times, actually), to no avail.
    I do not know the answer to whether MAC filtering is enabled on the router.  Have tried to find info about that, but unsuccessfully.  Router is an Arris TG852G, supplied by Comcast.  I would be surprised if MAC filtering were the issue, since in addition to the computer, we have successfully connected several other devices to the wifi, namely an iPad, a Android phone and a Kindle Fire - all able to access internet pages through the wifi, and all without a need to add the device to a MAC address whitelist.  To add to the mystery, the Comcast tech was able to connect his iPhone 4 to my network and access web pages.  He was unable to connect my iPhone, however, after trying for some time.
    I seem to recall reading somewhere that an iPhone cannot connect to a wireless "n" router, only "b" or "g".  The Arris router is described as a n/g/b compliant router, and as noted the Comcast tech was able to connect his iPhone, so don't know why that would be the issue here.
    By the way, my iPhone does connect wirelessly to my network at home.  This difficulty is at a second home.
    Any other thoughts would be appreciated.

  • I recently updated to latest version of ITunes for Windows and now takes 2 - 3 minutes to open and does not see my Iphone?  Any suggestions?

    I recently updated my ITines software to version10 and since the update it doesn't recognise my Iphone/  It also takes 2 - 3 minutes from clicking the icon to firing up the software.
    Is anyone else having this problem and how was it resolved?
    Thanks

    Actually, Chris, I found that page yesterday on my own doing a search, before I wrote my post.  After your instructions didn't work, I found that page and tried deleting the iAdcore.dll and that did not work.  When I tried to open it said it didn't have the iAdcore and could not be opened.  There was no QTMovieWin there to delete.  I again uninstalled everything in the order listed on this new page, because there were 7 things to uninstall (not 5 as your last page suggested).  I found that I had iCloud so that was deleted in the proper order.  Did not have MobileMe on the computer.  Also deleted Apple Application support, which wasn't on your list either.  I restarted the computer.  I looked for any files on drive C program files as indicated, and did not find any of those files.  I went to the iTunes page and downloaded the latest version yet again (maybe the 5th time?).  And I got the same notice:
    "The  iTunes Library.itl cannot be found or created.  The default location for this file is in the iTunes folder in the music folder."
    I went to that iTunes folder in the music folder there are a number of iTunes library folders and none of the open except one.  The ones that don't open give me the same dialogue box as above.  The last folder opens to a page of codes, I guess that's what it is.  Gobbeldy gook to me.  But that folder is listed at the top in the URL as itTunes Library.xml.  I don't see any .itl.  Is that the folder I need?  And how do I get that??
    I don't know if that last paragraph is significant, but I thought I'd include just in case it is.
    BTW, can I just download an older version of iTunes?  And how can I find it?  I still have the old version on my old computer which is at home.  Not sure how to get it from that to this one.
    Thanks for hanging in there with me.  Perhaps there is someone else who could help if you can't figure it out.

  • I am getting a "Prop Res DLL not loaded" message when trying to print from a website only while using Firefox, same does not occur using IE. Any suggestions

    An attempt to change the "Properties" options prior to printing on my Lexmark X5150 causes the message. Same does not occur if I do the same under Internet Explorer.

     I have tried creating the profile again and still get the same problem.  The problem is machine based and not user based. 
    Hi GG1234,
    If you recreated the Outlook profile and still got the same problem, please try to recreate the Windows Profile:
    Log on to client using local admin account->rename the profile folder under c:\users.
    By the way, did you try to print the mails in OWA?
    Frank Wang
    TechNet Subscriber Support
    in forum
    If you have any feedback on our support, please contact
    [email protected]
    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.

  • When I click on my mail button it does not update my email. Any suggestions on how to fix. This

    My email does not update when I click on it. How do I fix this

    Quit the mail app then reset your iPad.
    Double click the Home button to show the screen with running and recently used apps. Each app icon will have a sample page above it. Flick up on the page (not the app icon) and the page will fly away and the app icon will disappear. This quits that app. Then reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart.
    Also, when looking at the list of your emails that have already been delivered tap and pull down on that list then let go. This asked the Mail app to check again.

  • Have imac desktop with OS X.6.8 with three users two screens show dock third does not all dock settings same any suggestions

    Have imac desktop OS 10.6.8 with three users. two show dock items, one does not but all dock settings are the same for all three. Any suggestions as to problem solution?

    I found the problem. It is in Parallels 6 application. When windows applications folder is shown in dock Parallels uses 100% cpu and somehow effects ability to show dock and it remains hidden. I expect Parallels is working on this problem.  Temporary fix is to not have folder shown, then dock returns to screen.

  • XMLType extract method does not work if namespace attribute values are included

    In the example below, only the second row returns an ID from the extract function. The presence of an xmlns attribute appears to be the cause.
    SQL> drop table configs;
    Table dropped.
    Elapsed: 00:00:03.06
    SQL>
    SQL> create table configs (xml_data sys.xmltype);
    Table created.
    Elapsed: 00:00:00.02
    SQL>
    SQL> create index configs on configs (xml_data) indextype is ctxsys.context;
    Index created.
    Elapsed: 00:00:02.01
    SQL>
    SQL> insert into configs values(sys.xmltype.createxml('<config
    2 xmlns="http://www.ourcompanykscl.com/configuration">
    3 <dataformat
    4 name="F1" description="format spec" id="14082" version="2"
    5      status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDate="2002-05-10T09:44:45">
    6 <F11Format>
    7 <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    8 </F11Format>
    9 </dataformat></config>'
    10 ))
    11 /
    1 row created.
    Elapsed: 00:00:01.02
    SQL>
    SQL> insert into configs values(sys.xmltype.createxml('<config>
    2 <dataformat
    3 name="F1" description="format spec" id="14082" version="2"
    4      status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDate="2002-05-10T09:44:45">
    5 <F11Format>
    6 <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    7 </F11Format>
    8 </dataformat>
    9 </config>'
    10 ))
    11 /
    1 row created.
    Elapsed: 00:00:00.00
    SQL>
    SQL> BEGIN
    2 ctx_ddl.sync_index('configs');
    3 END;
    4 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    SQL>
    SQL> SELECT c.xml_data.extract('//dataformat/@id').getstringval(), c.xml_data.getstringval()
    2 FROM configs c
    3 WHERE CONTAINS(c.xml_data, '14082 INPATH (//dataformat/@id)') > 0
    4 /
    C.XML_DATA.EXTRACT('//DATAFORMAT/@ID').GETSTRINGVAL()
    C.XML_DATA.GETSTRINGVAL()
    <config
    xmlns="http://www.ourcompanykscl.com/configuration">
    <dataformat
    name="F1" description="format spec" id="14082" version="2"
    status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDa
    te="2002-05-10T09:44:45">
    <F11Format>
    <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    </F11Format>
    </dataformat></config>
    14082
    <config>
    <dataformat
    name="F1" description="format spec" id="14082" version="2"
    status="started" deployed="true" lastModifiedBy="bloggsj" lastModifiedDa
    te="2002-05-10T09:44:45">
    <F11Format>
    <SpecificationFilename>c:/formats/F1.txt</SpecificationFilename>
    </F11Format>
    </dataformat>
    </config>
    Elapsed: 00:00:00.03

    Hi Amarnath,
    Thanks for looking into my issue.
    When I started writing the dynamic custom approver group, I did not use FND_NUMBER and it didnt work. After that I checked it in the AME Implementation Guide which says
    "Queries for number and currency attributes must select the number or currency
    amount converted to a varchar2 by:
    fnd_number.number_to_canonical"
    So that should not be a problem.
    Please correct me if I am wrong but Now I see two different possibilities :
    1. The seeded variable :transactionId which is being passed to the query is not able to get the value. In other words, the transactionId is not being passed.
    2. I am using wrong Attributes to identify the transaction which is being used in the Condition and that condition is used in a Rule. In this case, I am trying to identify that the Basic Person details are changed and I am using seeded attribute HR_IS_PERSON_BASIC_DETAILS_CHANGE_SS in condition.
    Any feedback?
    Appreciate all replies.
    Thanks,
    CAH

  • Re ilife 11: I bought it so I could manipulate the sound WITHIN an imovie clip. The sound track in imovie 09 fluctuates wildly following export of the movie. It seems that ilife 11 in fact does not have improved controls. Any suggestions?

    Can I transfer my files to the apple movie "pro" system instead? I forget what its proper name is. With that programme like the old imovie of '05 approximately, you can grab the sound track within a clip and manipulate its volume up or down.
    I need to do that to compensate for the coder problems in imovie 09 and 11 soundtracks.

    ecivres wrote:
    ....you can grab the sound track within a clip and manipulate its volume up or down...
    This can be done quite easily in iMovie '11.
    Firstly, click on the waveform icon at the bottom right of iMovie's window (also at the lower right of the Project window) - shown here:
    You will see the volume level line within the waveform. For the section you wish to lower the volume, click and drag across the waveform so that it is highlighted with a yellow border. Now you can drag the volume line up and down. See the following example, showing the different volume levels:
    TIP: Set the thumbnail slider (next to the waveform icon) to half a second - this will show more detail in the waveform, with each thumbnail representing half a second of video.
    John
    Message was edited by: John Cogdell - added TIP

  • I've tried installing the latest Adobe Flash Player several times, but it does not seem to work. Any suggestions?

    One of the websites I use gives me this message:
    Alternate HTML content should be placed here. This content requires the Adobe Flash Player. Get Flash
    I have tried installing the Flash player several times, but I keep having this same problem.

    Can't see your Installed Plugins under More system details...
    Did you install the correct version of Flash? <br />
    IE uses a different version of Flash - ActiveX - than other browsers need - the Plugin version.
    1.Download the Flash setup file from here: <br />
    [http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player.exe Adobe Flash - Plugin version]. <br />
    Save it to your Desktop.<br />
    2. Close Firefox using File > Exit <br />
    then check the Task Manager > Processes tab to make sure '''firefox.exe''' is closed, <br />
    {XP: Ctrl+Alt+Del, Vista: Shift+Ctrl+ESC = Processes tab}
    3. Then run the Flash setup file from your Desktop.

  • ESATA express card does not work with Mavericks. Any suggestions?

    This is an Apiotek II 300 Express Adapter. I went out to Apiotek.com and it appears the domain is for sale. Is there any way to get a software update or do I have to buy a new Express Card that allows eSATA drives to work with Mavericks. I did a backup before I upgraded using X 10.7.5 and everything worked fine. The eSATA drive is not seen using Disk Utility either.
    Thanks for any help or suggestions.

    The driver has to come from the manufacturer of the card, so your two options are to get another card or to use your full backup to go back to 10.7.5. That assumes it's a clone backup and not Time Machine.

  • Web cam does not override iSight camera. Any suggestions how to do so?

    I bought a Logitech webcam but cannot get it to work. The iSight camera comes on instead and overrides the web cam. Any way to fix this?

    If your Logitech webcam is Mac-compatible, it should be menu-selectable in the app you are using. Different camera apps work differently. Your Mac's Help in each application should give you more info on how each particular app works, but here are a few examples:
      • Messages:
      • Photo Booth:
      • FaceTime:
      • Skype:
      •   QuickTimeX:
    If your camera recognizes only one camera, apps may not display even the inbuilt camera in the menu.
    Different iMovie versions support different cameras in different ways.  Search your iMovie > Help for info on your version.

Maybe you are looking for