Search found 46 matches

by Yanta
12 Jul 2020 01:30
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 12
Views: 1844

Re: Figuring out which computer is being used at two different locations

I've read that a few times, but I'm not following it. Perhaps I'm just tired. I've been working with this script for days now. I'll have to read it a few more times and get back to you. At present I've just set an environment variable on each PC Called SYSTEMLOCATION. It's working perfectly, but as ...
by Yanta
08 Jul 2020 05:28
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 12
Views: 1844

Re: Figuring out which computer is being used at two different locations

@penpen I have a very primitive implementation of what you describe. Some time ago I believe you assisted me with a backup script which does capture and store information as well as backup the registry, application data and so on. The postinstall script then does the reverse and applies all those ba...
by Yanta
07 Jul 2020 19:34
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 12
Views: 1844

Re: Figuring out which computer is being used at two different locations

Presuming the PC models are known and differ, you could use the PC model for comparison (For /F "Delims=" %%G in ('wmic computersystem get Model /Format:Value') Do Set "%%G")>Nul I thought of that. There are two problems (1). Motherboards are upgraded every 2 years so they never out of warranty and...
by Yanta
07 Jul 2020 19:29
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 12
Views: 1844

Re: Figuring out which computer is being used at two different locations

The PC name is the default DESKTOP-XXXXXXX random Windows one, so %USERDOMAIN% is out Unless you change that value every time you reboot your pcs, then i don't see, why it should be "out". In case you change that value every time you reboot your pcs, then just don't change that value on reboot. pen...
by Yanta
07 Jul 2020 06:35
Forum: DOS Batch Forum
Topic: Figuring out which computer is being used at two different locations
Replies: 12
Views: 1844

Figuring out which computer is being used at two different locations

My son has a computer here and one at his other parents place. The username is Corey on both computers, which he wants to keep. I have a script which does a thousand different tweaks, installs and so on... It works by username. His PC name is derived from %USERNAME%-PC. This is the standard that is ...
by Yanta
17 May 2020 04:16
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

The parenthesis was easy. I don't use ( or ) in comments if I can avoid it. So using notepad++ I counted the number of ( and ). 810 each, Now 819 each doe to removal of GOTOs Quotes are a little more difficult, so I just kept reading the script from start to end over and over, looking for " mismatch...
by Yanta
17 May 2020 03:57
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

No, I mean I removed any if statements that impeded my progress in debugging. Literally the only issue I could find was that the variables weren't set. There's nothing wrong with nested if statements. All good. There actually weren't any variables not set. I do actually have a not defined section a...
by Yanta
16 May 2020 21:08
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

I've just eliminated every GOTO in the script except the one to push the script to the end if it's not run from valid installation media.
That means adding more compound IF statements.
Ran it again.
Fails in EXACTLY the same place. The first non-remark statement after :L510.
by Yanta
16 May 2020 19:38
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

I wrote a script to echo a number after each line in your script. After getting to if /I "%DoGame:~0,1%"=="Y" ( it wouldn't progress past that. Since I know that code in parentheses gets parsed as a single block, I removed the if statement entirely. The script then continued on until it reached the...
by Yanta
16 May 2020 19:29
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

Doesn't matter that I put there, it will always be the first non-remark after the label. So, if you replace this line: IF /I NOT "%DoGame:~0,1%"=="Y" Echo %time% Not installing games >>C:\%USERDOMAIN%.PostInstall.Log 2>&1 with: echo 123 pause Your script fails? Absolutely. See above reply. It says ...
by Yanta
16 May 2020 19:27
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

Based solely on that snippet, it's failing because DoGame isn't set. My bad. I should have stated "You can assume all variables have been set". The code that does that is at the top of the script IF /I "%USERNAME%"=="Phillip" ( set DataDrv=F: set LogPath=F:\Logs set TempPath=G:\Temp2 set UserPath=F...
by Yanta
15 May 2020 23:52
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checksing tools for batch

Ouch. A$170. Well, I'll give it a go. Just out of curiosity, can anyone spot the bug here? The first non-remark after :L510 kills the script with 'the syntax of the command is invalid'. Doesn't matter that I put there, it will always be the first non-remark after the label. I've included the precedi...
by Yanta
14 May 2020 23:14
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Re: Debugging / syntax checking tools for batch

1-4 done. Many times. Echo off removed. it only runs from command line. It has to be run as administrator. I extracted the section of code where it fails with the "syntax is invalid" and it works perfectly. So I added in the preceding section, tried again, still ok. Added the next section in and tri...
by Yanta
14 May 2020 05:29
Forum: DOS Batch Forum
Topic: Debugging / syntax checksing tools for batch
Replies: 25
Views: 3843

Debugging / syntax checksing tools for batch

One of my scripts is 6,000 lines long. It has a bug. Invalid syntax or some such. I've spent a week going over the code so many times. I've checked of unbalanced parenthesis, quotes and so on. Damned if I can find it. So I used the batcodecheck program, but it's very basic and doesn't find any issue...
by Yanta
12 May 2020 06:54
Forum: DOS Batch Forum
Topic: Read file1 and remove the lines in that file from file2
Replies: 8
Views: 1889

Re: Read file1 and remove the lines in that file from file2

OMG!!! I'm a dummy... Flawed logic The master Hosts file is on my PC. As various lists are updated on github they are applied to the file I have. So that file has everything. The process I've currently been working on REMOVES lines from Hosts based on lines in another text file. I have another scrip...