Is it possibly to change file attributes for files in the Program Files directory?

Hi,
I wonder if it is possible to change file time atributes for a file that is in the same folder as the exe file inside the Program File folder. I have the following code that gives System Error Code 5.
SHGetFolderPath(0, CSIDL_PROGRAM_FILES, 0, SHGFP_TYPE_CURRENT, programpath);
PathAppend (programpath, TEXT("Testprogram/gnsh.dat"));
hFile = CreateFile(programpath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
If this had worked, I would for instance have done like this
GetSystemTime(&st); SystemTimeToFileTime(&st, &ft);
timeresult = SetFileTime(hFile2, NULL, NULL, &ft);
I am programming in C with WIndows Api.
Thanks in advance for answer.
Best regards

Hi Vahmat,
System error code 5 :
ERROR_ACCESS_DENIED
5 (0x5)
Access is denied.
I have tested your code on my side, it will get a error code 5 if you have no permission to access a file. Please try to run VS as a administrator and rebuild your project, after this , you code works well on my side.
Best regards,
Shu Hu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Is it possible to change file name policy in the JRE cache folder?

    We are getting calls from our clients complaining of slowdowns in loading our Java applet. The reason is a virusscanner. If a virusscanner is in the middle, it can drastically slow down the download process, and therefore cause some high delay before the user can work on the our product as expected.
    On this csutomer's side, it may take up to 10 min (the first time it is ran) instead of 1 min. JRE 1.6 is in use.
    They dont want to exclude from antivirus scan all files from Sun\Java\Deployment\cache folder.
    Question:
    Is it possible to change file name policy in the JRE cache to make it less unique?
    Thanks,
    -Dima

    dgomel wrote:
    We are getting calls from our clients complaining of slowdowns in loading our Java applet. The reason is a virusscanner. If a virusscanner is in the middle, it can drastically slow down the download process, and therefore cause some high delay before the user can work on the our product as expected.
    On this csutomer's side, it may take up to 10 min (the first time it is ran) instead of 1 min. JRE 1.6 is in use.
    They dont want to exclude from antivirus scan all files from Sun\Java\Deployment\cache folder.
    Question:
    Is it possible to change file name policy in the JRE cache to make it less unique?
    I suggest you solve the real problem - big files.
    There are two scenarios
    1. Initial download
    2. Updates.
    The first takes as long as it takes. No way around it.
    The second means that you can't use one jar. Otherwise every single update requires downloading the entire application every time. Multiple jars means only the one that changed is downloaded.

  • Possible to change color depth for Leopard's VNC server?

    I think it is very nice to include vnc server right into Leopard. But one problem, it seems it will only accept connection from clients when it is set to use full colors. This is painfully slow over WAN, any way to change the requirement from the server end?

    Possible to change color depth for Leopard's VNC server?
    Yes you can modify your screen sharing application so that you can adjust the colour depth. However you need to issue a command in the terminal to get this to work.
    http://www.macworld.com/article/131094/2007/12/screensharepower.html

  • Is it possible to change an IDOC and save on the same IDOC number..?

    Hi all,
    I have an IDOC. When I processed the IDOC, it ended up with error status '51'. There was some problem with the data. So, I changed the data and reprocessed using the T-Code 'WE19' and it was processed successfully. When we reprocess the IDOC using 'WE19', it generates another IDOC number. But, the client is asking that, it should not generate another IDOC number. When we change the IDOC number, it should be saved under the same(ORIGINAL) IDOC number. Is it possible to change an IDOC and save under the same number..? Is there any transaction code to do so. Please give your valuable inputs.
    Thanks in advance.
    Thanks & regards,
    Paddu.

    Hi,
    You can use the transaction WE09..to edit the IDOC data...
    Then use the transaction BD87 to post the IDOC..
    Thanks
    Naren

  • I have downloades Logic Pro 9 onto my older modfel Mac Book Pro 1,1 with OS 10.6.8 and 2 GB RAM, according to the rquirements for Logic 9. the program should run, but it won't open. Is my configutation too slow?

    I have downloades Logic Pro 9 onto my older modfel Mac Book Pro 1,1 with OS 10.6.8 and 2 GB RAM, according to the rquirements for Logic 9. the program should run on OS 10.6.8. with 2 GB RAM, 4 GB better, but it won't open. Is my configutation too slow?

    Looks as if you're just at the minimum specs - http://www.apple.com/logicpro/specs/. Says 2GB minimum, 4GB recommended. And 2GB of RAM is all the RAM the 1,1 can handle. If I were you I would call Apple's App Store service center - you have the minimum requirements, as I read it, but perhaps you need a faster processor?
    I had a 1,1 but sold it when I bought my late 2011 in March of this year - maybe it's time to look at a new machine?
    Clinton

  • I installed Elements 12 because my version of Photoshop (CS5.1) is not compatible with Yosemite. Now the Adobe Application Manager will not search for updates for any of the programs in CS5.5 that I have. How do I fix this?

    I installed Elements 12 because my version of Photoshop (CS5.1) is not compatible with Yosemite. Now the Adobe Application Manager will not search for updates for any of the programs in CS5.5 that I have. How do I fix this?

    '''Except 8.0.x version also supported version is 3.6.24 '''you can find it here:
    http://www.mozilla.org/en-US/firefox/all-older.html
    check the system requirements:
    http://www.mozilla.org/en-US/firefox/3.6.24/system-requirements/
    see also:
    [https://support.mozilla.com/en-US/kb/Installing%20a%20previous%20version%20of%20Firefox Installing a previous version of Firefox]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • I Just bought iMovie for yosmite and the program will not open.. I will like a fix or a refund..

    I Just bought iMovie for yosmite and the program will not open.. I will like a fix or a refund.. i am getting tired of these problems...

    Welcome to the world of downloaded software. There are no refunds.
    Back in the good old days when software was purchased on disk one could sell it (legally).
    Please describe your problem.  Give us some details to go from.   Are you using iMovie 06, or something newer?

  • When I want to change date of picture, iPhoto close the program. Why?

    When I want to change date of picture, iPhoto close the program. Why?

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?
    Post back with the result.

  • After editing for a while the program slows to a crawl how do I fix this?

    After editing in iMovie for a while the programs slows down - especially when I have heavy graphics and audio in the time line.  Can anyone help me with this problem?

    How much free space do you have on your disk drive?

  • It would be possible to change windows license for mac license. I have CS6.

    Hello, I bought Adobe Creative Suite 6 Design and Web Premium for Windows. However, I would buy a IMac and I would like to inquire whether it would be possible here to change windows license for mac license.Thanks for responding.

    yes, Order product | Platform, language swap

  • Is it possible to change an attribute of image using VB?

    hello everyone!,
    I just want to ask if it's possible to add an attribute to a image using Visual basic. and the image will save as jpeg file together with the add attribute to the properties?
    by the way, I am john. freshman college student from phil. thanks in advanced
    chow..

    Hi acamar,
    Below is the error I've encounter modify the codes under exifwork
    a = WindowsApplication.exifwork.Rational cannot be converted tp 1-dimensional array of windowsApplication.exifwork.rational
    Public
    Function ToRational(ByVal
    value As
    Double)
    As Rational()
    Dim N
    As
    Double = value
    Dim D
    As
    Double = 0
    Dim S
    As
    Double = 1
    If N = N \ 1
    Then
    Return
    New Rational(Convert.ToInt32(N), 1) <--a
    End
    If
    If N < 0
    Then
                N *= -1
                S = -1
    End
    If
    Do
    Until N / 1 = N \ 1
                N *= 10
                D += 1      
    Loop
            D = 10 ^ D
    Dim divisor
    As
    Integer = gcd(N, D)
            N /= divisor
            D /= divisor
            Convert.ToInt32(N)
    Dim R
    As
    New Rational(Convert.ToInt32(N), Convert.ToInt32(D))
    Return R <--a
    End
    Function
    also in the function setpropertyrational3 the method(PutInt32 is not declare).. what is the declaration type of that and where do i put the declaration?
    We're close.. i really appreciated your Help.. :)
    Jonel

  • Possible to register a Proxy for FTP in the FTP-Communication-Channel ???

    Hi All,
    I have a question regarding the ftp-receiver-communication-channel.
    I have configured an integration scenario for a file-transfer via ftp to New York. I use the File/FTP-Adapter from SAP. I send the files in the passive ftp mode, but only the filename (no content) is created at the ftp server in new york. we get the error: 425 --- Can't open data connection. The Firewall and so on is open for this process and we tested it from other servers. There occurred always the same exception. We have no idea where the mistake could be.
    When we arrange FTP-connects with a ftp-programm (for example WS_FTP) we use a proxy. And it's working.
    Here my Question:
    Is it possible to register a proxy / ftp-proxy in the xi-system or in the File/FTP-Adapter?
    Thanks and best regards
    Christopher

    When you connect to any FTP server it writes some dump to your local system first then opens the data connection. So check whether you have provided neccessary rights on the XI server so that it writes to the local system...
       I think thats when it throws that error...
       Also check whether you have opened necessary ports...it uses port 21and 1024+ ports for passive connections and 21 and 23 for active connections....
       Are you connecting to the other ports rather than standard port 21....then also try connecting through port 21 because if you use other ports it won't work sometimes. Its worth trying with port 21 because if FTP is on UNIX box....the inet daemon on unix box automatically reroutes to the appropriate port after it recieves the connection from port 21.
          And also did you tried connecting to FTP server through you XI server using some other FTP client.
    Hope this helps...
    Regards,
    ravi

  • For CS6 is there an easier way to redirect all my files and folders for all of the programs?

    Hey adobe people, Im wondering, I know you can setup each preference individually, but I want to redirect all the catched space, storage of brushes, and etc for all my programs into another disk volume as in changing c/ to e/. Is there a way to do this with in one program to make it easier? I don't want to accidently delete files that all the adobe programs can't find.
    The reason is I don't want to store anything other then the programs on the SSD, and in theory I want the other drive, so it can run faster.

    There is no global option for this.
    Mylenium

  • Changing date format for some of the date columns in a subject area

    Hi,
    I have a requirement to change the date format for some of the date columns to dd-mon-yyy for only a particular subject area. Is there a feature available in the RPD which can help me do this?
    In Answers - Column Properties for a Particular column of a report, we can save the style and formatting as system wide default for the particular column or the data type, but that applies across subject areas.
    I tried with the config files too , but that too applies to all suject areas.
    Thanks in Advance,
    Gaurav

    Why don't you create 2 logical column derived from same date physical col and then change the format for one logical column and use it in Subject Area ?

  • Is it possible to change a SAP BW password from the BI Launchpad?

    Hello,
    We are currently running:
    Business Objects 4.1 SP4
    Apache Tomcat Web Server
    SAP BW 7.3 SP 7, ABAP stack only
    We are using SAP BW as our primary EDW with BI 4.1 as a front end for Reporting and Analytics. SAP Authentication is enabled in BOBJ and that is used as the authentication method for all users. The majority of our user have no reason to ever log onto BW as all of their BI content is attainable through the BI Launchpad. (Analysis and Design Studio)
    When a new user is created in BW, it is mandatory by policy for them to change their password upon first login. However, the only way they can do this is by logging in to the SAP GUI to BW. Can this be achieved somehow through the BI Launchpad?
    Thank you
    Scott

    It is not possible to change it in LaunchPad unfortunately, workarounds are discussed here:
    http://scn.sap.com/thread/3355098
    Best regards,
    Victor

Maybe you are looking for

  • Can i generate more than 1 library for 2 ipods?

    I have a mini ipod and just bought a nano ipod for someone else. We are using the same computer. how can i generate another library for his use?

  • What is the best way to  back up iTunes excluding external hard drive

    *iTunes gives you the option of backing up your library on CDs. It would take me 100s of CDs to back up my library. Is there any other way to back up excluding external hard drive? Can you put music on a DVD and fit more than on a CD? Having just had

  • IN REPORTS

    HI in reports , how to display the output in a user defined screen.

  • B1out type="object_full" Error Message?

    I am looking for an example of a "B1out type="object_full"" out format for an AR-Invoice or similar doc type? When I use the regular "type="object"" there are no errors but when I change it to the "type="object_full"" and add the Control and Payload

  • Address Book Search Feature Died

    I'm baffled. One minute I'm using Address Book fine. The next, I type any text in the search box and the results come up blank. All my contacts are still there. They show up if I click on "All" or on any of my groups I've created. But I cannot search