Search found 3883 matches

by Squashman
24 Dec 2018 00:11
Forum: DOS Batch Forum
Topic: Delete substring using variable inside for /f
Replies: 7
Views: 193

Re: Delete substring using variable inside for /f

Call Set "_dummy=%%_cities:!_substr!=%%"
by Squashman
24 Dec 2018 00:06
Forum: DOS Batch Forum
Topic: Advice Question - how to check to see if file has already been ran?
Replies: 3
Views: 103

Re: Advice Question - how to check to see if file has already been ran?

You expect someone to go through all that code? You would be villafied with extreme prejudice on other forums. How about you post a minimal but complete and verifiable example.
by Squashman
12 Dec 2018 12:05
Forum: DOS Batch Forum
Topic: 7zip issues
Replies: 2
Views: 147

Re: 7zip issues

Just reading the online help. It says that -X is to exclude file names. Does not say anything about folders. I would say make a file list of all the files in that folder then use that file with the exclude option. According to this SuperUser post the paths have to be relative. So you just use -xr!ar...
by Squashman
11 Dec 2018 08:18
Forum: DOS Batch Forum
Topic: Batch file does not continue running commands
Replies: 2
Views: 142

Re: Batch file does not continue running commands

That is a loaded question. You need to better explain what your real task is and why you think you need to use CMD /k. Because you seem to want to use CMD /K, this would be your only option. @ECHO OFF cmd.exe /k "winver &exit" PAUSE So you need to explain why you wouldn't just run this? @ECHO OFF cm...
by Squashman
10 Dec 2018 16:15
Forum: DOS Batch Forum
Topic: Get current directories
Replies: 3
Views: 153

Re: Get current directories

You can also just type the CD command.

Code: Select all

H:\temp\temp>cd
H:\temp\temp
by Squashman
10 Dec 2018 11:41
Forum: DOS Batch Forum
Topic: How to pass Yes automatically in a batch script?
Replies: 3
Views: 183

Re: How to pass Yes automatically in a batch script?

The FORFILES command is grabbing files and folders. When the script tries to delete a folder it will prompt you with that. It will not prompt to delete files.
by Squashman
09 Dec 2018 21:19
Forum: DOS Batch Forum
Topic: Burn ISO to USB command
Replies: 6
Views: 243

Re: Burn ISO to USB command

Why do you need to do this from the command prompt? Microsoft created a tool to boot from USB drives to install Windows. Why not use that. It has been around since Windows Vista if memory serves me.
by Squashman
09 Dec 2018 21:18
Forum: DOS Batch Forum
Topic: Batch subtraction with leading zero
Replies: 2
Views: 128

Re: Batch subtraction with leading zero

Been covered dozens of times on the forum if you search.

Put a 1 in front of the number so that it become 108. Then subtract 1. Then substring the last two positions.
by Squashman
09 Dec 2018 16:41
Forum: DOS Batch Forum
Topic: Adding a column to a csv file and populating it
Replies: 21
Views: 13160

Re: Adding a column to a csv file and populating it

I'd also like to chime in with my problem, maybe you can help a total newbie out: I have a dir with several csv files, each named after a company. Now I want to add that filename (minus the .csv) as the first colum inside the csv (which can have different number of rows, from 4 to 600+). The delimi...
by Squashman
06 Dec 2018 13:42
Forum: DOS Batch Forum
Topic: Creating a folder with today's date
Replies: 5
Views: 258

Re: Creating a folder with today's date

My teaching style is to teach a man to fish. It really helps to know all the commands you can use within a batch file. You can type help at a command prompt to get most of them. H:\>help For more information on a specific command, type HELP command-name ASSOC Displays or modifies file extension asso...
by Squashman
06 Dec 2018 12:49
Forum: DOS Batch Forum
Topic: Creating a folder with today's date
Replies: 5
Views: 258

Re: Creating a folder with today's date

I would assume you are aware of the %date% and %time% variables. But those are both region dependent and may not output the same on everyone's computer. So the other option is to use WMIC to get the date and time because it always outputs in the same format on all computers regardless of region sett...
by Squashman
28 Nov 2018 16:30
Forum: DOS Batch Forum
Topic: About call Function with Arguments
Replies: 3
Views: 233

Re: About call Function with Arguments

When file and folder names have spaces in them, what are you supposed to do?
by Squashman
28 Nov 2018 13:38
Forum: DOS Batch Forum
Topic: How to create an UTF-8 file (instead of UCS-2 Little Endian)?
Replies: 3
Views: 214

Re: How to create an UTF-8 file (instead of UCS-2 Little Endian)?

I thought we had a thread going on the forum about creating a UTF-8 file with a BOM. I can't find it.
by Squashman
28 Nov 2018 13:33
Forum: DOS Batch Forum
Topic: How to I replace " by ' " (at the start and end of a string in a variable)? Doubling Backslashes?
Replies: 4
Views: 213

Re: How to I replace " by ' " (at the start and end of a string in a variable)? Doubling Backslashes?

If you have control over the code why would you assign the double quotes to the variable in the first place. That has never been a best practice on this forum.