[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Cant get Batch file to work! HELP
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 25
Thread images: 3
File: 1452835553008.png (394 KB, 800x1000) Image search: [Google]
1452835553008.png
394 KB, 800x1000
Im trying to create a batch file which should delete the contents within the specified directory when the directory reaches 5 gigs. So i created a batch file.
http://pastebin.com/q7kQ7ChC
However when i click the batch file. I see the cmd window flash open and close immediately. The file continues to fill up with the temp files past 5gb. What is my problem here. I cant figure it out. :( Any help is appreciated thanks!
>>
>>52453205
It just checks for files larger than 5GB, not folders.
>>>/sqt/
>>>/dpt/
>>
Add "pause" as the last line in your .bat to see the output. Perhaps you don't have privileges to remove. You can try using Autohotkey instead of batch.
>>
>>52453233
Is there a way to check folders?
>>
>>52453238
i added pause to the end like u suggested. The cmd/bat file performed the same. It opened up and closed immediately
>>
>>52453271
> EXIT /B /0
Uh, it can't pause after it ends. Try adding the "pause" command before the "exit" command in a separate line, it should prompt you "press any key to continue..." and you'll get to see the output before you press it.
>>
File: dsdsdsds.png (48 KB, 1094x678) Image search: [Google]
dsdsdsds.png
48 KB, 1094x678
>>52453306
Still the same result
>>
>>52453340
*facepalm*
Swap the pause and exit lines, do you really think it can pause after it exited?
>>
>>52453340
>Jump out of the car
>Step on brakes

or

>Step on breaks
>Get out of the car
>>
>>52453371
same result, batch file opens and immediately closes.
>>
>>52453340
Voice recordings? Wtf are you doing?
>>
>>52453444
My surveillance software records, audio files, and video files.
>>
>>52453477
Sounds sweet as fuck care to share more?
>>
>>52453205
Launch as admin
>>
>>52453631
Launched as admin, same result with pause at the end. Windows opens quickly and disappears
>>
>>52453668
Your windows user is named 'user'? If not change it in a variable. Still try to run it as admin
>>
File: Description Cat side.jpg (47 KB, 720x599) Image search: [Google]
Description Cat side.jpg
47 KB, 720x599
>http://ss64.com/nt/for_f.html
>>
>>52453727
yes my windows name is user
>>
>>52453205
Permission issue? Have you tried running as admin?
>>
>>52453244
OK so now I understand what you need but I'm too lazy to help you. Find your latest pooinloo and ask them to make it for you. Or you join irc channels #powershell or #windows or #windows-server. Sometimes they are helpful. Or maybe just find third party software that does this for you?
>>
>>52454311 again.

http://stackoverflow.com/questions/31531152/command-or-tools-to-get-the-folder-size-in-windows-other-than-using-dir-or-du
>>
>>52454311
On which network are those IRC channels?
>>
Just make a variable that increased in size for every file you scan, that way you add up the total size and then could just delete them all or delete the older ones looking for modification date.
I made some batch for my work.
>>
>>52454454
Freenode.
>>
>>52454532
There doesn't seem to be a #windows on Freenode, but there is a ##windows
Thread replies: 25
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.