Thanks.
Couldn't figure it out so I've had to code 150 lines in my batch file instead.
Search found 48 matches
- 28 Aug 2021 19:54
- Forum: DOS Batch Forum
- Topic: Delete files in folder B which exist in folder A
- Replies: 5
- Views: 4642
- 28 Aug 2021 05:02
- Forum: DOS Batch Forum
- Topic: Delete files in folder B which exist in folder A
- Replies: 5
- Views: 4642
Delete files in folder B which exist in folder A
I have two folders. Folder B contains 300 files. The complete set. Folder A contains a subset of folder B. About 120 files. I want to delete the files in folder B that exist in folder A Essentially, folder A is a list of files that are safe to be deleted from Folder B. If it's any easier, I can simp...
- 02 Oct 2020 16:15
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
Re: command returns no value even though entry exists
Rem Max Payne 2 Set GamePath= Set D2Test= for /F "Usebackq Tokens=1* delims=," %%a in ("%SrcPath%\folders.txt") do IF /I "%%a"=="Max payne 2" set GamePath=%%b Echo %time% Path: "%GamePath%" >>C:\%USERDOMAIN%.PostInstall.Log 2>&1 IF NOT "%GamePath%"=="" IF EXIST "%GamePath%\" IF EXIST "%SrcPath%\Max...
- 17 Sep 2020 20:18
- Forum: DOS Batch Forum
- Topic: How to handle file names with &
- Replies: 2
- Views: 4054
- 17 Sep 2020 19:56
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
Re: command returns no value even though entry exists
Here is what it looks like. There are over 120 games so I won't post the entire games section.. When I said I "Created the file fron scratch" not one line of this code was changed. I recreated the folders.txt file from scratch. The only changes I've made recently are to add .exe to the end of those ...
- 17 Sep 2020 04:29
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 28351
Re: Debugging / syntax checking tools for batch
Indeed. Both of those were pointed out some time ago. And I removed them all a long time ago. It's possible I missed something, but they don't cause the debugger to fail or warn so it's easy to miss them in a long script. I shall check again. EDIT: Nope. All labels that were within ( ) blocks had al...
- 17 Sep 2020 04:05
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
Re: command retunrs no value even though entry exists
No, no, I didn't re-write any code at all. When I said I "So I deleted the entire file and recreated it from scratch" I meant I recreated the folders.txt file. There is no old code vs new code. The same code worked after recreating the folders.txt file, imho, reinforcing the earlier statement @ojbak...
- 16 Sep 2020 21:12
- Forum: DOS Batch Forum
- Topic: How to handle file names with &
- Replies: 2
- Views: 4054
How to handle file names with &
I have a font I want to install called Spirit & Ghost.ttf The following code processes a list of font files in a folder. SET SRC=%CD:~0,2% set SrcPath=%SRC%\PostInstall\%USERNAME% :FONTS IF EXIST "%SrcPath%\Fonts\" ( Echo Installing Custom Fonts Echo %time% Installing Custom Fonts >>C:\%USERDOMAIN%....
- 14 Sep 2020 05:23
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 28351
Re: Debugging / syntax checking tools for batch
Just thought I'd update on this. My script is now 8,000 lines and still growing. I've found a free easy to use IDE that includes a debugger from https://sourceforge.net/projects/batch-compiler/ Does lots more than just syntax check and debug scripts, but they are the only features I need atm. Since ...
- 14 Sep 2020 04:32
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
Re: command retunrs no value even though entry exists
I still am..
I compared the folders.old.txt with the new one I created and there was 1 byte difference in the file size, but they looked identical. (3610 vs 3609 bytes)
Code: Select all
IF /I "%DoGame:~0,1%"=="Y" (
Game 1
Game 2
Runescape
Game 3
Game 4
etc
)
- 13 Sep 2020 04:17
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
Re: command retunrs no value even though entry exists
Is seems there is something in you Folders.txt that is not visible in the lines you have posted. You need to examine what is going on inside the for-loop to see why it fails on Runescape. Add the following code to yout batchfile, run it and check the new file FolderDEBUG.txt "%SrcPath%\foldersDEBUG...
- 11 Sep 2020 00:13
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
Re: command retunrs no value even though entry exists
Yes. I suspect if SrcPath was not defined the other 30 or so games would also have failed. SrcPath is J:\PostInstall\Corey, see below... SET SRC=%CD:~0,2% set SrcPath=%SRC%\PostInstall\%USERNAME% set RegPath=%SRC%\PostInstall\%USERNAME%\Applications I've run it dozens of times and it is null every s...
- 09 Sep 2020 20:05
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 16848
command retunrs no value even though entry exists
Recently I received some excellent support in reading a list of items from a text file and assigning the result to a variable. However, it seems to be struggling with a single entry. This is an abridged list of the games... Overwolf,D:\Program Files (x86)\Overwolf Quake,I:\Program Files (x86)\Quake ...
- 20 Aug 2020 19:22
- Forum: DOS Batch Forum
- Topic: Stop search when exact match found.
- Replies: 2
- Views: 3813
Re: Stop search when exact match found.
Legendary stuff.
For some reason I struggle to get my head around the FOR command and assigning variables to stuff. I don't know why. I don't usually have learning disabilities
thanks
For some reason I struggle to get my head around the FOR command and assigning variables to stuff. I don't know why. I don't usually have learning disabilities
thanks
- 20 Aug 2020 08:50
- Forum: DOS Batch Forum
- Topic: Stop search when exact match found.
- Replies: 2
- Views: 3813
Stop search when exact match found.
I have a text file with the following... Cities Skylines,I:\Games\Cities Skylines Mass Transit Mass Effect,I:\Program Files (x86)\Mass Effect Mass Effect Andromeda,I:\Program Files (x86)\Mass Effect Andromeda Mass Effect 3,I:\Program Files (x86)\EA\Mass Effect 3 I search the file with.... for /F "To...