Jump to content



Photo

Delete File From Adddata?

special folder delete file appdata file path

  • Please log in to reply
3 replies to this topic

#1 myubo

myubo

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 February 2019 - 02:52 AM

Hi I need to add a line to my bot which deletes a file from AppData/Roaming/.../file.txt

 

Since every person has a different path to AppData folder how do you go about this?  How do you find out what the current users username is e.g:   C:\\Users\\  THIS COULD BE ANYTHING  \\AppData\\...?

 

I tried without success:  delete file("{$special folder("AppData")}\\Roaming\\...



#2 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3140 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 February 2019 - 11:31 AM

Special Folder appdata includes the Roaming part of the path, so maybe remove that.

 

You can see the path it gives you here:

alert($special folder("Application Data"))

And it will change if your username is changed, for example, mine is this:

C:\Users\Nick\AppData\Roaming

I'm sure yours is different unless you have the same username



#3 myubo

myubo

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 February 2019 - 11:41 AM

Awesome thanks bud, changing AppData to Application Data, and removing Roaming worked :).  Final code:

 

delete file("{$special folder("Application Data")}\\UBot Studio\\cef_browser_log.txt")



#4 myubo

myubo

    Member

  • Members
  • PipPip
  • 15 posts
  • OS:Windows 7
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 07 February 2019 - 08:29 PM

Actually if anyone else has issues with file ref_browser_log.txt becoming HUGE, mine got to 12gb once.  

 

Just go to the file and under preferences change it to read-only.  This is good for personal use, not great if you are selling bots however.







Also tagged with one or more of these keywords: special folder, delete file, appdata, file path

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users