Windows scripting

You like a certain distro? Tell us why here

Moderators: b1o, jkerr82508

Forum rules
Try to avoid "fanboyism" Spam is strictly forbidden. The general rules apply: viewtopic.php?f=8&t=568
User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Windows scripting

Postby viking60 » 07 Nov 2011, 13:35

I have often read and ignored Windows fanboys criticizeing The Linux CLI and scripting. This is only for strange nerds and will never become mainstram.
That is why Linux will never become mainstream or even get close to compete with Windows.
In the good old days I can distinctly remember that I did a lot of scripting in Windows and it was particularly useful for changing the Admin password after a bunch of idiots had gotten access to them over a beer after work hours or during Lunch etc... etc.... Or it could be that I simply needed to have the same password on all computers or a group of computers.
I made a text file with all the PC's to change the admin password on and just ran it from my location. Like we do here in our backup script.
I used pspasswd.exe for this:
Usage: pspasswd [\\[computer[,computer,[,...]|Domain]|@file] [-u Usernam
ssword]]] Username [NewPassword]
computer Direct PsPasswd to perform the command on the remote
computer or computers specified. If you omit the comput
name PsPasswd runs the command on the local system,
and if you specify a wildcard (\\*), PsPasswd runs the
command on all computers in the current domain.
@file PsPasswd will change the password on the computers list
in the file.
-u Specifies optional user name for login to remote
computer.
-p Specifies optional password for user name. If you omit
you will be prompted to enter a hidden password.
Username Specifies name of account for password change.
NewPassword New password. If ommitted a NULL password is applied.

And it was all CLI.
In those days there was this independent site called Sysinternals.com and the guru was Mark Russinovich. And the tools were good.
Image
Guess what happened? The site was sold to Microsoft and that is where MR is working today. The tools are getting less powerful and some goodies are removed but they are still there - and quite good! +1

Remember if you use some of those commands without a bit of studying first they will eat your hamster (Or someone else's hamster). :-D
And here they are:
http://live.sysinternals.com/

Now make a folder on C: called skript and download the skripts there.
goto c:\skript and try out a command like rammap
(Please tell me that I do not have to tell you to download rammap.exe first :-D )
With psexec you can start programs locally but also externally (If I remember this correctly) so it is quite powerful.

To test it you can simply write psexec notepad in the cmd terminal.
But being a window user it is only a matter of short time before you forget where you keep your scripts so we have to do better than that:
So to execute the commands from everywhere (in Win7) just put the file psexec.exe in the C:\Windows folder.
Now it will always work as a part of Windows.
It might be a good idea to put psinfo there too. Or psloggedon etc etc.
If you really want a powerful tool you put procexp.exe and procexp.chm in C:\windows then you have a brilliant process explorer.
Image
Ah.... it is almost as good as w or du or... Get it?

So what am I doing here, giving Window tips?
Eh ... where did that Whiskey bottle go.... Ah I just remembered :idea:
If you actually do master your Windows you will be using the CLI!!!

So this is a prophylactic action so that Hairyfeet (actually blogging quite good about the shortcomings of Linux even if he is dead wrong) and other Windows fans do not spend so much time explaining to Linux users how good Windows is.

The likelyhood of the Linux user knowing more about Windows than the Windows fanboy, is well above 80% IMO.
And the Sysinternals.com site was a haven for me back in the day.
Even today it is quite good (yes it is Microsoft ..... where is that Whiskey bottle ).

(PS: the very observant techs amongst you might have noticed that it would be a good idea to have all those scripts on a USB-pen.)
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Windows scripting

Postby rolf » 07 Nov 2011, 15:00

Image Image

I've always been a little fascinated with the powerful DOS prompt. Going straight to Linux soon after I first started using computers, I don't see it much, mostly when flashing a BIOS.

Programmer Karen Kenworthy, a former writer at Windows Magazine and author of Karen's Power Tools Newsletter, passed away earlier this year. She did a good job explaining some of the internals of Windows and wrote programs for it that might interest you, available at Image

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Windows scripting

Postby viking60 » 07 Nov 2011, 15:17

Thanks!
And before I forget it you can download the pstools bundle here:
http://technet.microsoft.com/en-us/sysi ... s/bb896649

(Does pskill ring a bell :-D )
Now over to Karen.......
Oh yes! Good stuff there to. I need a Lan monitor so I downloaded it. What I find somewhat... bad is that you have to install it. The sysinternal tools are all standalone files (that are portable on a USB-pen).
But that Lan monitor is nice ... very nice.... Must try more....
Edit:
Well I wanted to, but I got so tired of having to reboot for every change that I just stayed out of there. My main problem is a 1079 error that refuses to start the workstation service. And without it Windows will not communicate with samba.
I am to spoiled with Linux; so going back two steps is always difficult. Windows simply is not berserk ready +1
I don't need it (and it works on other Win7 boxes). I dual boot with this Win on my Mandriva box so I never use it anyway.

Spending some time in Windows really put things in perspective. I will be less critical towards Linux problems after this - for sure!
Windows 7 is far behind; to an extent that I doubt that it will ever be able to even come close to Linux.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Windows scripting

Postby dedanna1029 » 07 Nov 2011, 21:12

This is exactly what the "Problem Solving Concepts with C++" class that I'm taking now is for; Windows scripting.

*sigh - not enjoying it much, but then the only single time I use Windbloze is when I'm at school anyway.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Windows scripting

Postby viking60 » 07 Nov 2011, 22:04

Yes Windows has a program for keeping Linux out of schools - So you will be using Winose. But Scripting is a Linuxy way of doing things so it does not have to suck. That eternal rebooting is driving me mad though and no workspaces. :wall:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Distro talk”