Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help]Create program files folder when run[Solved]

[Help]Create program files folder when run[Solved]

Posts 1–15 of 17 · Page 1 of 2
Physcadelic
Physcadelic
[Help]Create program files folder when run[Solved]
Well this is VERY nooby, but I just started VB.

When the user runs the program I want a folder to be created in their program files, and a .txt inside that folder. I know how to do this, but how would I actually name the folder like "Test Program" and the .txt to actually contain text. How would I write text to the .txt when the programs runs?
#1 · 15y ago
Blubb1337
Blubb1337
[php]Io.Directory.CreateDirectory("Path")
[/php]
[php]
Using sWrite as new io.streamwriter("Path", append as boolean)
swrite.write(text)
end using[/php]
#2 · 15y ago
Physcadelic
Physcadelic
Getting alot of errors doing that.
#3 · 15y ago
Blubb1337
Blubb1337
Quote Originally Posted by Physcadelic View Post
Getting alot of errors doing that.
Good, since ik your code + errors, I can sure help you.

Oh wait...
#4 · 15y ago
Physcadelic
Physcadelic
Quote Originally Posted by Blubb1337 View Post
Good, since ik your code + errors, I can sure help you.

Oh wait...
Sorry, just telling you
Code:
Public Class Form1
     
     Io.Directory.CreateDirectory("C:\Program Files\programname")
   Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
    swrite.write(Text in filename.txt)
    End Using
Errors: End using must be preceeded by a matching using.
Io.Directory.CreateDirectory("C:\Program Files\programname") - Declaration expected at IODirectory.CreateDirectory("C:\Program Files\programname") -
Declaration Expected at sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
Statement cannot appear out of method body: Using sWrite as new io.streamwriter("C:\Program
#5 · 15y ago
IA
Iamazn1
Instead of
Code:
Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
    swrite.write(Text in filename.txt)
    End Using
use
Code:
IO.File.WriteAllText("C:\Program Files\programname\filename.txt", "Contents of filename.txt")
#6 · 15y ago
Jason
Jason
Quote Originally Posted by Physcadelic View Post
Sorry, just telling you
Code:
Public Class Form1
     
     Io.Directory.CreateDirectory("C:\Program Files\programname")
   Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
    swrite.write(Text in filename.txt)
    End Using
Errors: End using must be preceeded by a matching using.
Io.Directory.CreateDirectory("C:\Program Files\programname") - Declaration expected at IODirectory.CreateDirectory("C:\Program Files\programname") -
Declaration Expected at sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
Statement cannot appear out of method body: Using sWrite as new io.streamwriter("C:\Program
Lolz I please you to actually look at code before C+Ping it.

[php]
IO.Directory.CreateDirectory("C:\Program Files\programname")
Using sWriter As new IO.StreamWriter("C:\Program Files\programname\test.txt", False)
sWriter.Write(String.Join(ControlChars.CrLf, New String() {"Please read", "The fucking code", "before you copy it"}))
End Using
[/php]

And put the code in a method body for gawds sake.
#7 · 15y ago
Physcadelic
Physcadelic
Quote Originally Posted by Iamazn1 View Post
Instead of
Code:
Using sWrite as new io.streamwriter("C:\Program Files\programname\filename.txt", append as boolean)
    swrite.write(Text in filename.txt)
    End Using
use
Code:
IO.File.WriteAllText("C:\Program Files\programname\filename.txt", "Contents of filename.txt")
Thanks, that worked, and thankyou too Blubb, I guess I'm just too stupid to understand your code..
#8 · 15y ago
Jason
Jason
Physcadelic, don't get all mad at me for voting against copy and pasting, there's no need to throw around negative rep just because you can't handle criticism.
#9 · 15y ago
Hassan
Hassan
Quote Originally Posted by Jason View Post
Physcadelic, don't get all mad at me for voting against copy and pasting, there's no need to throw around negative rep just because you can't handle criticism.
Lol, agree. Btw, what was the de-rep message ? :P
#10 · 15y ago
Jason
Jason
Quote Originally Posted by Hassan View Post


Lol, agree. Btw, what was the de-rep message ? :P
Quote Originally Posted by Physcadelic
Yeah I'm new, don't have to be a jerk..
So yeah... Thanks for the rep though Hassan.
#11 · 15y ago
Physcadelic
Physcadelic
Quote Originally Posted by Jason View Post
Physcadelic, don't get all mad at me for voting against copy and pasting, there's no need to throw around negative rep just because you can't handle criticism.
ohshit sorry about this, was a total overreaction
Anyone that reads this de-rep me
#12 · 15y ago
Hassan
Hassan
Quote Originally Posted by Physcadelic View Post
ohshit sorry about this, was a total overreaction
Anyone that reads this de-rep me
There's no need to de-rep you as I repped him already, but be careful next time. If you won't face the criticism, you won't be able to learn new things.
#13 · 15y ago
'Bruno
'Bruno
Quote Originally Posted by Hassan View Post


There's no need to de-rep you as I repped him already, but be careful next time. If you won't face the criticism, you won't be able to learn new things.
are you on drugs son? I rage all over the place to anyone who says im wrong!!!
#14 · 15y ago
Jason
Jason
Quote Originally Posted by Brinuz View Post
are you on drugs son? I rage all over the place to anyone who says im wrong!!!
Yeah but you're never wrong so you have a reason to be annoyed
#15 · 15y ago
Posts 1–15 of 17 · Page 1 of 2

Post a Reply

Tags for this Thread

None