Results 1 to 8 of 8

Thread: [RESOLVED] Protected computers & AppData folder

  1. #1

    Thread Starter
    Addicted Member Davor Geci's Avatar
    Join Date
    Sep 2009
    Posts
    222

    Resolved [RESOLVED] Protected computers & AppData folder

    Hello,
    if I have an exe file that doesn't need any installations and people that are on computers that are protected from installations of any software use it and I need to store some data somewhere on that machine, can I do it in the AppData folder?
    Or how would you do it, where to create an txt file?
    Thanks,
    Davor
    My projects:
    Virtual Forms
    VBA Telemetry

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Protected computers & AppData folder

    For text files I'd probably let the user decide. Give them a Save As dialog.

  3. #3

    Thread Starter
    Addicted Member Davor Geci's Avatar
    Join Date
    Sep 2009
    Posts
    222

    Re: Protected computers & AppData folder

    Thanks dilettante for your quick reply.
    I have simplified my problem too much.

    I have a simple exe created in vb6 that communicate with a php script on my webpage and filters a mysql database for a key.
    I want to convert this exe file to Base64 string and include it in a VBA class in an Excel workbook.
    Then when a user opens this Excel workbook, in the initialization of this VBA class I would like to recreate this exe (convert this Base64 string back to this exe) in a folder on this computer, I was thinking in AppData folder.
    So that now I could start this exe with a command arguments and it will call my php file on my page to get the keys from mysql database.

    I wanted to use this exe between Excel workbook and my database so that I can first see if the user is having a valid subscription. Because as you know in VBA all the code is visible, so I wanted to use a vb6 app that doesn't require installations and the code is not visible to users.

    Will I be able to access this AppData folder (or any other folder) on this protected computers, where I can recreate my exe from this Base64 string?
    My projects:
    Virtual Forms
    VBA Telemetry

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,156

    Re: Protected computers & AppData folder

    You can use Environ$("TMP") as a simple way to discover a writable folder on *any* protected or not desktop.

    You can temporary store (and execute) any kind of files there, provided that it's not flagged as malware by Windows Defender.

    cheers,
    </wqw>

  5. #5

    Thread Starter
    Addicted Member Davor Geci's Avatar
    Join Date
    Sep 2009
    Posts
    222

    Re: Protected computers & AppData folder

    Thanks guys,
    I will try with TMP.
    Davor
    My projects:
    Virtual Forms
    VBA Telemetry

  6. #6
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    Re: Protected computers & AppData folder

    Quote Originally Posted by Davor Geci View Post
    I will try with TMP.
    In the Colibrico-App (an SVG-based Icon-Designer), I've solved this "Online-Licensing-check-thingy",
    by using an "encrypted String of VBScript-code" (included in a resource of the executable)...

    And all without having to place this Code-String in the FileSystem first... -
    instead it got (after decrypting it) - directly added to a (short-living) ScriptControl-instance.
    (FYI, the CreateObject("WinHttp.WinHttpRequest.5.1")-call works in VBScript as well).

    Olaf

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [RESOLVED] Protected computers & AppData folder

    some users do purge their tmp folders from time to time
    a "your" folder in appdata may be preferable, unless you do not care about permanency
    i am sure appdata is just for the purpose of application data files, else you could also use program data
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8

    Thread Starter
    Addicted Member Davor Geci's Avatar
    Join Date
    Sep 2009
    Posts
    222

    Re: [RESOLVED] Protected computers & AppData folder

    I'm also using a temporary txt file for storing the results that I get from the server, so that I don't bombard my server with query's. Once per day I query the server and store the results in txt. I will first try with AppData, and see how it goes. And in the meantime Olaf idea is also interesting.
    By the way, so that you know what I'm doing. I'm creating an Agent that will send the telemetry data to Azure Application Insights from VBA projects (Excel, Access, ....). I have already something similar (vba telemetry). But the main problem was that it needed a setup to be run on every machine where we wanted to collect the telemetry data. So it was not unusable in most cases.
    My projects:
    Virtual Forms
    VBA Telemetry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width