Windows Batch Scripting for Beginners and how to use it.

What is a Batch file?

Most people will never really understanding what the extension .bat is in Windows or even DOS.  However it is something that is native to programmers around the world because it is the first thing most people who make programs or works with scripting start to use way before they do anything else.  It should be considered the first linguistic languages that is very powerful.  It is designed to be used in DOS but can also be used in Windows as a DOS command easily and effectively through Windows OS.   Some of these are what you should explore even more to learn how to program and create scripts even more.  However this blog post is just a introduction into doing it and how you can use this in your everyday IT Job.

According to Wikipedia:

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching.

Understanding scripting is the first part in creating powerful scripts for everyday use.  However, I am one of the few to use the help command in DOS:

HELP [command]

This is a good tool for those who might want to explore the power of using a Batch to get your job done or to creating a batch file because you will need to know what you can use in the batch file.

Here are a few commands you might want to use in a batch file:

  • SET /P variable=[promptString]
  • Start of the batch file ECHO OFF and ECHO ON after the batch file is complete.
  • If and THEN (Wikipedia)
  • CALL filename.bat

Creating Batch files

I’m not going to go into much details about creating the batch in the way you might need but I will be talking about this in general about ways you can create a batch and which programs are good at helping you create a batch file.

First you need a program to create it.  You can always use Wordpad or Notepad but you could find it isnt’ a good as Notepad ++.   I have used it in the past for programming in many different programming languages such as Pascal, C++, COBOL, and SHELL Scripting.  I’ve talked about SHELL scripting in past for LINUX which you can use Notepad++ for it also to create Linux shell scripting.  I will say you can do a lot with the open-sourced program that is free to use.  So I always want to use this with anything I am doing because it shows you where you might have a problem in your scripting language and helps you identify how to fix it.  You’re best advice is to just try to think about what you want to accomplish with a batch file and start thinking logically about how you would do that.

You will need to make sure the .batextension is on the file name.  Make the filename something that you can easily run in DOS because you don’t want to make the batch file anything complicated because that might not work properly if you use a call command in another batch file.  So consider the naming convention of your batch file(s).

Trial and Error

After creating the batch file you will need to do some trial and error test to make sure it will work with what you need to use it for and also make sure there isn’t something unexpected.   This is what programmers do all the time by compiling  the program and running it on different systems to see what it will do in different Windows environments.

Finally, You will see that you can do so much more with a batch that you previously did and it can be a great asset in doing repetitive stuff at work or at home.   If you do this right it can even help speed up your life.   Here are a few Blog posts that I have talked about previous:

As you can see these will help you understanding scripting but also help you to figure out what you might want to do with a Batch and why you might need to create a batch file.  Even I know this is only a few blog post that will at least hopefully give you even more ideas on what will help you to create batch files.

Don’t forget to like and subscribe to my blog page for even more updates.   Do you have a favorite DOS command?  why not share it with others so they can learn even more.

Friday Video Picks: Job Market and You!

Why is it so hard to Find a Job in 2024?

Is the job maketing getting worse or better? I don’t know but I suspect we will see in the coming weeks as to why it seems that way. Here are a few youtube videos that will help show you that you aren’t alone in this job searching and applying for jobs.

I personally agree with this video because there seems to be a disconnect between the employer and prospective employees trying to pay as little as they can towards the employee to do simple stuff and keep them from not finding another job down the line.  According the the Bureau of Labor Statistics it is sitting at 3.7 right now.

Chart from Bureau of Labor and Statistics

As you can see the job went up doing the covid shutdown and we had a 34% unemployment that went steadily down to where we are now at 3.7% which doesn’t quite make me feel like this is going to get any better but more worse in the coming months due to everyone will eventually need to get unemployment insurance to survive and the number will rise sooner than later this year just by what I am seeing in the job market unless something happens and companies stop being picky.

The Labor Market and Job Applications

I know it has been an interesting few days for me since my lay off last week.  I will even say some of this is definitely not something I would want to give to an enemy.   I have been applying for jobs and trying to find a job for over a week and it looks like slim pickings right now for where I have been and where I want to go.   Not to mention, that we are having so many people trying to find a job and keep a job is something that will help make your job searching any better.

The Job market and Me!

I don’t know what to say about these two videos but they were very well documenting just how hard others are having the same issue as I am and it looks to be something that will last few a while.   I might have to find jobs that aren’t related to the tech industry for the time being just keep money coming in.   Are you experiencing not finding a job in the the technology industry?   How’s it going for you?  Have you had the same issues others have had?  Why not leave a comment and start a discussion on what it has been like and don’t forget to subscribe to my blog for more blog posts about my journey into finding a job.   Happy Friday everyone!

How to deal with Stress after a Job Loss!

Social Media Camp 2009 By Dean Meyers

Job Searching Stress

Let’s face it, no one can says it is easy to Job search and not be stressed because you need the money or even trying to provide for your family. Stress is the one thing that comes with a Job loss for one reason or another. We will always have stress and concerns and living expenses are always a concern because of not having a job. We can have many reasons why we lost but in the IT industry right now due to hiring to many IT people and seeing they need to rearrange how many people they may need.  I know Job searching right now really sucks and it used to be so easy to find another job but now everything is different.  People not quitting and the IT market not wanting to hire people because of budgeting.   So it is just a matter of time before this all equalizes and IT industry starts to hire people.   I just don’t see this being fast as I may need it to be.

Dealing with Stress

So how do you deal with stress while looking for a job?   I am sure I am not the only one who has asked that the past few days.   I figured I would at least share you how I am dealing with it and maybe it will help with your job searching and how to reduce your stress.

  • Exercise – This has helped me tremendously because exercise gets me tired and makes sure I sleep through the night.   I find dedicating an hour or two of getting exercise daily helps keeps the stress from creeping up on me and it seems to keep from having sleepless nights.  So it is always suggested to get as much exercise as you think you might need per day to help you with your attitude and sleep.
  • Eat a Balanced Diet – Don’t over do it with any foods and manage your food intake when it’s possible and don’t forget to drink plenty of water instead of drinking anything to much like Soda’s and other caffeine drinks.   if you can avoid doing it after Sometime in the afternoon that will prevent you from have a sleepless night.
  • Hobbies – Find hobbies that will help you deal with the stress.  I like to write so this blog is a way for me to keep my stress down by doing something I love to do.  If you can find something that you enjoy doing can make your stress get better over the time you are looking for a job.  This has helped in many ways if you have some hobbies that can you can do will help you.
  • Support –  Find people who can help you deal with stress like family and friends who know your struggle and will give you words of encouragement to let you know they are there for you.  Also they may know of a job or two that you might not know of to apply for.
  • Sleep – Getting enough sleep is always a good idea to reduce the stress and keep you from having stress.  So figure out how to get a good night sleep even if you have to use Melatonin from time to time to keep your sleep regular.   I don’t suggest it every night but I’ve used it once or twice a week when I know I need it but I try to avoid caffeine and stimulants as much as possible during the end of the day to help with my sleep.
  • Limit your Job searching – No matter how much your job searching you shouldn’t dedicate your whole 8 hours a day to job searching because that isn’t going to go over well.   Limit your job searching to a maximum, I suggest 1 to 2 hours in the morning and maybe 1 hour in the evening and applying when you see a job.

Networking

Finally to help with your job searching, I suggest asking people if they know of any jobs that you may be able to apply for.   This is something that helped me with stress also because they can be looking for a job also for me and may find a job that I didn’t know anything about or may know one from where they are working and I may just need to apply for to get the job.

Nothing is set in stone in these suggestions because no one is the same as me and you should should take these suggestions as to how you will deal with stress and what has worked for you but I am sure these will help you even more in your job searching and stress.   What’s something that has helped you in your stress reduction?  Why not leave a comment and tells others what has worked for you.  I am always curious how people deal with stress and how they also are dealing with the Job Searching.   Don’t forget to like this post and also tell people who might need an encouragement that they aren’t alone in this job searching.  We’ll all in this together and you aren’t alone in having to find a new job.

Why companies are claiming Entry Level Positions on Job applications!

Job application by Nick Youngson CC BY-SA 3.0 Pix4free

Why Recruiters Try to Trick Applicants?

This is one of the  ways that really makes me think this is a RED flag that you shouldn’t go to this company even if you are desperate because you will not last long. In the long run, it is something that I don’t get why they do this other than a few possible reasons. I’m going to break them down for you and try to explain it even more.  Here is one Example of that I have seen in the last week:

No mentioning of Entry Level Position.

As you can see when they called for the first level of interviews they were adamant that it was an Entry level position but I had some problems with that comment and pointed it out to the hiring manager. She avoided saying why that was but I know there was more to this than they are willing to talk about.

Cheap Labor – This is the main reason they try to tell people without posting it in their job description is that they want to get the cheapest labor they can.  9 times out of 10 this is the reason they try to get say this to get those who have the experience to go down in their amount they are wanting to get hired.   This isn’t the best way to draw in applicants by making the job seem less than it is and it doesn’t help with retaining people in the long run.

Bait and Switch – This is also sometimes why they do this to get you in the door to give you even more work than you thought you would be getting into.   I haven’t had this happen to me yet but I am leery of them doing this.   I know they are trying to find people for certain roles but I would think they would be honest about it.

Underlying Problems

There are so many underlying problems with this approach but I won’t go into them all.  I however think most companies would want the best possible talent they can get.   However that isn’t how it is, most companies work for their CEO and their stock holders.   They have to make money and paying people what is right to work and even inflation considerations wouldn’t work well for the ones who have the stocks and even CEO wouldn’t get as much money.

Pay for Entry Level

When they told me the pay they are willing which was 17$, I was a bit shocked because the even if they want to pay you the lowest hourly rate out there that just means they don’t value their employees and this just shows it even more.   According ZipRecruiter when I looked up the pay range for It Support Specialist Salary it was more than they are willing to pay which means that I shouldn’t count on them calling me back or I should continuing looking for a new job somewhere else because they obviously aren’t looking to pay me what I deserve to be paid.

In the Meantime

Well in the mean time, I’ll apply for other jobs and consider this jobs as loss and try looking for another job that will pay me more than this previous interview.   I know there must be companies out there that will value their employees.  I’ll start asking more questions and tell them my pay expectations up front.   I don’t want to get low balled and trying to find a job that isn’t a good fit.  Each time I get an interview I am hesitant to talk about my pay requirements because they will likely trying to undercut me and give me something that isn’t even range that I might need or require to live.   Are you having the same issues or problems like I am looking for a new job?   Companies trying to pay you less than you deserve or maybe they aren’t even calling you back?  Let’s create a discussion about this so others can find out just how hard this can be right now.   Don’t forget to subscribe to my blog if you like what you read.

3 Dos commands that you need to know!

DOS Rocks!

Direcotry of System or Disk Operating System (DOS) is one way the technology is good at fixing certian issues. I am going to talk about some that you might or may not know about.  Each command is good for those who are connected to through a network or network group.   If these system are on the same workgroup and are on the shared through the network this will help you in solving those really problems.   You’ll love these as much as I use them because they are really good at keeping you looking like a genius.

FSUTIL (Microsoft learn)

C:\fsutil volume diskfree \\(Shared drive)  

You’ll need to add the \\ as the shared drive or shared system that you want to know how much space is left on it if you need to know at a quick glance will this file or program fit on this drive.   It’s very useful for those times that you may need to keep track of the space.

QUERY (Microsoft Learn)

query session /server:computername

query users /server:computername

one of thse can be used to determine if there are users who might be causing problems by being logged in but aren’t actually doing anything on the system.   These users could be from a previous shift or might of been logged in for a while without any activity.  So this helps to know if a program or access is causing another user from not being able to do their job one way or another.  This is great tool for corporations where more than one users could be using the system at one time or another.

LOGOFF or SHUTDOWN

logoff [<sessionname> | <sessionID>] [/server:<servername>] [/v] (Microsoft Learn)

shutdown /l /r /m:(Computername)  (Microsoft Learn)

Each one of these commands does about the same thing but one reboots the system also because you never know when the remote system might need to be rebooted also after forcing the user to logoff.   So you can decide which one you might need to user remotely for a system.   You can even add in comments or tell the reason why the system rebooted with the shutdown command by adding  /d [p : u](Planned or Unplanned with a number 1-256) .   I will remind you to be cautious as to what you put down as the reason and you can even specifiy how long to wait before the system reboots by adding /t 0-256 MINUTES.   Each one of these command can be helpful for you when you are trying to solve some minor major issues with a system not working properly.

DOS is Powerful

Wheather you want to believe it or not, DOS can be a very useful tool for those who might need to fix issues with the system like windows and other issues that you might need help to fix certain issues that might arise on the system.   You can find some great useful tools at the DOS prompt but you have to be willing to learn it even more than most because it is so much like Linux.   I definately say old and new techs should know how to do this and use the dos prompt when you need to fix issues.  Do you have a favorite command prompt that you use?   Why not leave a comment and tell people about the command that you think is the most useful command?   I’d like to hear it and learn even more about the power of using the DOS prompt.