The fastest way to get code that is robust and efficient is to clearly describe what you need to do and then let the programmers decide the best way to handle the job.

State which tools you'd like to use in your script or which utilities you can't use or leave it up to the volunteers. Read below on how to give good information about your task so the script you are given doesn't fail!

Batch files are often specific to your task because your filepaths, text, filenames and data are often used to write code that is both simpler and more efficient.

It makes it easy for people if you provide accurate details. The script you are given is designed to work in your specific situation and they will often add extra code to handle aspects that you may not have thought of. Personal information in your question can be disguised and is mentioned below.

If you hide your details by using fake names and fake paths and fake file information then nobody knows if you are using things like non-latin characters, or unicode, or poison characters for batch scripts. In these situations the volunteers can't include appropriate code to handle your special situations because they aren't aware you need it.

By providing poor information about your task the code you are given stands a good chance of failing.

Batch code is often written by analysing the characters and the patterns in text/numbers/paths/filenames that are being handled by the batch script. Wrong analysis, when all you have is wrong data, just leads to wrong batch code.

The layout of your text, numbers, paths, and filenames is also important when writing code so type over the sensitive details in your examples to disguise them but don't change the layout or length of these lines.

Please show respect to those people who give their free time to provide you with code by giving them accurate information about your task.

Come back later and tell them if the code helped you, and saying thank you after you receive some help doesn't cause hairy palms or bad luck so give that a shot too.

What happens in a thread when incorrect or poor details are supplied: is that the volunteers write a script based upon that information and the next post often comes from the question writer saying "It doesn't work!"

Often a very long series of posts begins where we try to ascertain what the problem is and how the code fails and then what the real details of the task are. The script has to be rewritten, and that just wastes the time of those volunteers who are giving you free code and it is terribly frustrating and unsatisfying for volunteers to have to re-write a script for the same task again.

Problems with batch scripts happen for many minor reasons on a computer. The time spent in question/answers to find out these things can be reduced to only minutes rather than spanning days for several messages to go back and forth asking you what these things are.

This script bundles a number of these key points of information in a simple text format in Notepad for you to copy and paste into a message. The volunteers can often begin writing a script for you immediately and you can have your answer very quickly.

1) Visit this link to copy and paste the script from the initial post into a bat file:2) run that script3) and copy/paste its output into the next post in your thread:

*)Does the script spy on my data?No. The script is designed to give a range of non-personal information and not to harvest any kind of private or sensitive data. It is designed to help you receive a solution to your task quickly, by giving essential and useful details for people to help you with your script.

*)Why do you need hundreds of lines of code to gather this information?The changes in each Windows version and also user settings and permissions need to be checked and handled in different ways. The extra code you see is for all the extra ways of obtaining the same information in different computer setups.

*)Could the script change or damage my computer?No. The script is written to read information without changing any of it. It writes a plain text file showing the information that is gathered and makes it easy for you to copy it and paste it into a reply. The file is deleted automatically.

*)Why do you want to know these details?The changes in Windows settings means information is needed to write code that handles things like dates and times, and newest and oldest filenames and folders, and filesize sorting and other aspects. This provides the details in a quick and easy way for you.

Microsoft made a mistake in not providing ways to run scripts in any language or regional settings when using things like dates and times and DIR listings etc. These things change across different computers and cause the most frequently asked questions in batch file scripting.

*)Enabling Extensions and Delayed ExpansionSome commands change the way batch file commands work so that detail is needed too.The usage of exclamation marks '!' is changed when Delayed expansion is enabled and it alters how environment variables are written and used within program loops.

*)LanguageThe language/locale name and the code page number can affect the way text characters are handled in languages other than English and it can also change batch scripts themselves. Special allowences need to be made in some cases for a script to work.

*)Missing files and path elements Some checks are made to show if batch file commands are missing or the way they are accessed has changed. If there are missing files or they can't be accessed in the usual way then it shows a significant problem, and you can be informed and also helped to fix the issue.

The environment variables %path% and %pathext% have entries that cause batch scripts to fail if they are missing and so they are checked too.

Examples of external commands that are checked are findstr.exe, timeout.exe, sort.exe, mode.exe, ping.exe

*)Windows version and releaseDifferent versions of Windows and levels within each version can have different commands, so this information lets the volunteers write code for your version of Windows without any delay.

*)DIR listing and pagefile.sysIf pagefile.sys is present it is used for the DIR format listing where the date/time/filesize format gives the volunteers these details to help them write code which uses them.

The figure of virtual RAM and reboot time are only two of the many small indicators that are assessed together to rule out certain problems if scripts fail or if computer performance is affected.

*)Permissions informationSome commands require elevation to higher administrative permissions and we can tell here what pointers to provide when there is a problem with a script which is known to require higher access levels.

*)Running the script is, of course, optional.If you can provide accurate and good sets of details regarding your question/problem then you will still get people willing and interested to help you.