Conversation

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: MS DOS batch file ebook.

#1 Post by berserker » 26 Dec 2013 01:58

Ed Dyreen wrote:'
Batch is slow and doesn't handle unicode yet Microsoft refuses to update their native scripting language.
Whether this is to stay compatible with older software or to favor their other products is not sure.

yes they did, that's why they are now called VBscript or Powershell.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: MS DOS batch file ebook.

#2 Post by Ed Dyreen » 26 Dec 2013 19:54

berserker wrote:
Ed Dyreen wrote:'
Batch is slow and doesn't handle unicode yet Microsoft refuses to update their native scripting language.
Whether this is to stay compatible with older software or to favor their other products is not sure.

yes they did, that's why they are now called VBscript or Powershell.
They are alternatives to batch not replacements or updates.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: MS DOS batch file ebook.

#3 Post by berserker » 26 Dec 2013 23:23

Ed Dyreen wrote:They are alternatives to batch not replacements or updates.

depends how you look at it.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: MS DOS batch file ebook.

#4 Post by Squashman » 27 Dec 2013 16:33

i have never looked at Vbscript being a replacement for Batch. Powershell though I do kind of see that as a replacement because it has its own shell. But the nice thing about all of them is they work quite nicely with each other.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: MS DOS batch file ebook.

#5 Post by foxidrive » 27 Dec 2013 19:00

VBscript and Powershell can both be used with Batch files, and both are preinstalled.

With Perl on the other hand, it needs to be installed by the user and in many cases the user can't do that
- restricted by company policy etc - so it makes it a poor choice for general purpose scripts to assist people.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: MS DOS batch file ebook.

#6 Post by berserker » 28 Dec 2013 00:44

foxidrive wrote:VBscript and Powershell can both be used with Batch files, and both are preinstalled.

rarely there is a need for batch files already if vbscript or powershell is used for general programming purpose. ( although the command line is still needed to run the interpreters)

foxidrive wrote:With Perl on the other hand, it needs to be installed by the user and in many cases the user can't do that
- restricted by company policy etc - so it makes it a poor choice for general purpose scripts to assist people.


the reasons not to use them are only man made.

Its not just Perl. PPP (Perl, Python, PHP), even Ruby (or others like Java etc) has come a long way and now could be used for system admin tasks. They provide convenient libraries and data structures for fast prototyping and development.

"restricted by company policy" is not an excuse anymore, if the sysadmin can justify using them. Especially in the competitive environment sysadmins simply cannot spare the time to think of how to solve problems using arcane methods etc. and not to mention, how to maintain lines and lines of unreadable code without going mad.

most of these "restricted by company policy" rules are due to security reasons, whatever they are or how absurd they are. I believe with a proper audited security policy and taking precautions, "restricted by company policy" rule should be removed.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: MS DOS batch file ebook.

#7 Post by berserker » 28 Dec 2013 00:58

Squashman wrote:i have never looked at Vbscript being a replacement for Batch. Powershell though I do kind of see that as a replacement because it has its own shell. But the nice thing about all of them is they work quite nicely with each other.


in a technical sense, there is not such thing as "replacement".
In the past, there is Assembly. People find that they can be more productive, so someone created C. But that doesn't mean C has replaced Assembly. because in other niche areas Assembly could be still needed. (this is just a hypthetical example)

What is being "replaced" is in the mind.
I would really like to program in C for example, for all my system admin task. But there a lot of other tools available that people put together to make the job easier and faster. So I used them and totally ditch C. I have "replaced" C with some others. (this is also another hypothetical example)

That's why, depends on how you look it.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: MS DOS batch file ebook.

#8 Post by Squashman » 28 Dec 2013 07:51

I agree with using the right tool for the job but like we have all said restrictions do come into play for a lot of us. Powershell is an awesome sysadmin tool and can do plenty of other things as well. It has plenty of pre-written cmdlets as well as others that have written plenty.

The one nice thing about it is it does handle reading large text file better than batch it has the capability to tell the script how many lines you want to read into memory at a time.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: MS DOS batch file ebook.

#9 Post by foxidrive » 28 Dec 2013 09:25

berserker wrote:
foxidrive wrote:VBscript and Powershell can both be used with Batch files, and both are preinstalled.

rarely there is a need for batch files already if vbscript or powershell is used for general programming purpose. ( although the command line is still needed to run the interpreters)

That's the funny thing - this forum is dedicated to batch scripting, with help from tools that are native and a few third party tools where the task to too unwieldy for a reasonable batch file.

There are a number or people that bend batch in miraculous ways too. That's the beauty of batch scripting - it's fun.
foxidrive wrote:With Perl on the other hand, it needs to be installed by the user and in many cases the user can't do that
- restricted by company policy etc - so it makes it a poor choice for general purpose scripts to assist people.


the reasons not to use them are only man made.

Its not just Perl. PPP (Perl, Python, PHP), even Ruby (or others like Java etc) has come a long way and now could be used for system admin tasks. They provide convenient libraries and data structures for fast prototyping and development.

"restricted by company policy" is not an excuse anymore, if the sysadmin can justify using them. Especially in the competitive environment sysadmins simply cannot spare the time to think of how to solve problems using arcane methods etc. and not to mention, how to maintain lines and lines of unreadable code without going mad.

It is the regular user that comes here to get some help, rarely a system admin. Many tools are locked down for regular users, so they can't efficiently trash the system, and they can't install programs.

Often you will also get people asking specifically for a native solution - without VBscript/Jscript or Powershell or any third party tools - purists or students learning in a course.
most of these "restricted by company policy" rules are due to security reasons, whatever they are or how absurd they are. I believe with a proper audited security policy and taking precautions, "restricted by company policy" rule should be removed.

Maybe so, but you or I believing it isn't going to change what the current reality is.

It's true that people with a smattering of knowledge can really cause damage with scripting tools, and that's a fair reason to lock things down in a commercial environment.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: MS DOS batch file ebook.

#10 Post by berserker » 28 Dec 2013 19:53

foxidrive wrote:That's the funny thing - this forum is dedicated to batch scripting, with help from tools that are native and a few third party tools where the task to too unwieldy for a reasonable batch file.
There are a number or people that bend batch in miraculous ways too. That's the beauty of batch scripting - it's fun.

I am sure you are proficient enough in vbscript/powershell to understand what they can do. So my comment is not unfounded and absurd. It really has nothing to do with whether this forum is batch scripting oriented or not or people exploiting batch to its limits. That is not a point of contention.

foxidrive wrote:It is the regular user that comes here to get some help, rarely a system admin. Many tools are locked down for regular users, so they can't efficiently trash the system, and they can't install programs.Often you will also get people asking specifically for a native solution - without VBscript/Jscript or Powershell or any third party tools - purists or students learning in a course.

Are you sure you want to attest to that statistics.? by the way, when i say system admin, its really not just system administrator as a job. I am referring to functions. Sending email, moving files, copying file etc etc. Its not only done system administrators, but i classify them as system admin functions.
Why would someone want a batch to run in a environment specially locked down for not allowing it? If its for personal use, that shouldn't be a problem to use other tools. If they are restricted and have legitimate reasons to run batch, then they should get the proper permission and proposals on how to do the job.
purists + students? How many are there? what about the rest? what are they categorized as?
Without any statistics done, considering this is a public website, i am sure others not purist or students would have came here to learn some things as well regardless of profession. In the process, they might have learnt some better ways to do things as well. What are we to stop people from doing this?

foxidrive wrote:Maybe so, but you or I believing it isn't going to change what the current reality is.
It's true that people with a smattering of knowledge can really cause damage with scripting tools, and that's a fair reason to lock things down in a commercial environment.

in a real environment, programmers code in a test/uat environment. before implementation, code has to be audited. after that only security/system admin can implement the app. on production system, only necessary libraries installed + other kind of security lockdown, not excluding physical security. Don't tell me these things cannot be easily done?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: MS DOS batch file ebook.

#11 Post by foxidrive » 28 Dec 2013 21:00

berserker wrote:
foxidrive wrote:That's the funny thing - this forum is dedicated to batch scripting, with help from tools that are native and a few third party tools where the task to too unwieldy for a reasonable batch file.
There are a number or people that bend batch in miraculous ways too. That's the beauty of batch scripting - it's fun.

I am sure you are proficient enough in vbscript/powershell to understand what they can do. So my comment is not unfounded and absurd. It really has nothing to do with whether this forum is batch scripting oriented or not or people exploiting batch to its limits. That is not a point of contention.


That's the funny thing. In the dozens of posts you've contributed, I haven't seen you post a batch file. :)

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Conversation

#12 Post by berserker » 28 Dec 2013 21:10

foxidrive wrote:
That's the funny thing. In the dozens of posts you've contributed, I haven't seen you post a batch file. :)


well, the funny thing is this. I know how to solve the problem , but am just too lazy to code in entirety and post the solution. I prefer to guide how to fish, than to fish for them. you understand what i mean ? I will leave the fishing for people like you , who are ever so helpful providing full solutions. keep up the good work. :)

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: MS DOS batch file ebook.

#13 Post by Squashman » 28 Dec 2013 21:28

berserker wrote:
foxidrive wrote:
That's the funny thing. In the dozens of posts you've contributed, I haven't seen you post a batch file. :)


well, the funny thing is this. I know how to solve the problem , but am just too lazy to code in entirety and post the solution. I prefer to guide how to fish, than to fish for them. you understand what i mean ? I will leave the fishing for people like you , who are ever so helpful providing full solutions. keep up the good work. :)

The irony in that comment is that you have been more than willing to post all your Perl code.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: MS DOS batch file ebook.

#14 Post by foxidrive » 28 Dec 2013 21:33

berserker wrote:
foxidrive wrote:That's the funny thing. In the dozens of posts you've contributed, I haven't seen you post a batch file. :)

well, the funny thing is this. I know how to solve the problem , but am just too lazy to code in entirety and post the solution.


So your goal is to sit on the sidelines and yell obscenities at the referee? :)

No offense intended but from your input to date it's doubtful that you know how to script in batch, to solve the problems. Maybe you could solve them in perl.

berserker
Posts: 95
Joined: 18 Dec 2013 00:51

Re: MS DOS batch file ebook.

#15 Post by berserker » 28 Dec 2013 21:43

Squashman wrote:
berserker wrote:
foxidrive wrote:
That's the funny thing. In the dozens of posts you've contributed, I haven't seen you post a batch file. :)


well, the funny thing is this. I know how to solve the problem , but am just too lazy to code in entirety and post the solution. I prefer to guide how to fish, than to fish for them. you understand what i mean ? I will leave the fishing for people like you , who are ever so helpful providing full solutions. keep up the good work. :)

The irony in that comment is that you have been more than willing to post all your Perl code.


1) this is a batch forum. I am sure people like yourself or foxi + others are there already to post batch solutions. It doesn't matter if I did.

2) there are more than 1 way to do things. Some of it are more productive and certainly benefits some. I am more inclined to provide alternative views to solving the same problem. You cannot deny the fact that , unless otherwise stated, TS may have the means to use other tools at his disposal. Hence i do certainly hope the mods can give the benefits of the doubt first.

3) Language like Perl || others have made things easy. Hence, posting "full" is rather easy and sometimes no brainer. :)

Locked