Search found 48 matches
- 28 Jul 2020 21:34
- Forum: DOS Batch Forum
- Topic: Figuring out which computer is being used at two different locations
- Replies: 12
- Views: 8817
Re: Figuring out which computer is being used at two different locations
Thanks everyone. Lots of great ideas! @siberia-man: Yes, this manual process works. I was trying to automate the process, but have not yet found a way. The PC Name when Windows is installed is random. The script I'm writing actually changes the name into something more meaningful, but it can't be us...
- 28 Jul 2020 06:38
- Forum: DOS Batch Forum
- Topic: Understanding substitution in variables - solved
- Replies: 0
- Views: 17546
Understanding substitution in variables - solved
I'm trying to install a bunch of fonts. srcpath=H:\PostInstall. There are 26 ttf files in the folder. I have some fonts that are already installed and some that aren't. I've just set it up with echo atm so I can see what's happening. original code for %%a in ("%SrcPath%\Fonts\*.?tf") do call :instal...
- 12 Jul 2020 01:30
- Forum: DOS Batch Forum
- Topic: Figuring out which computer is being used at two different locations
- Replies: 12
- Views: 8817
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 ...
- 08 Jul 2020 05:28
- Forum: DOS Batch Forum
- Topic: Figuring out which computer is being used at two different locations
- Replies: 12
- Views: 8817
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...
- 07 Jul 2020 19:34
- Forum: DOS Batch Forum
- Topic: Figuring out which computer is being used at two different locations
- Replies: 12
- Views: 8817
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...
- 07 Jul 2020 19:29
- Forum: DOS Batch Forum
- Topic: Figuring out which computer is being used at two different locations
- Replies: 12
- Views: 8817
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...
- 07 Jul 2020 06:35
- Forum: DOS Batch Forum
- Topic: Figuring out which computer is being used at two different locations
- Replies: 12
- Views: 8817
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 ...
- 17 May 2020 04:16
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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...
- 17 May 2020 03:57
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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...
- 16 May 2020 21:08
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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.
That means adding more compound IF statements.
Ran it again.
Fails in EXACTLY the same place. The first non-remark statement after :L510.
- 16 May 2020 19:38
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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...
- 16 May 2020 19:29
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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 ...
- 16 May 2020 19:27
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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...
- 15 May 2020 23:52
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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...
- 14 May 2020 23:14
- Forum: DOS Batch Forum
- Topic: Debugging / syntax checksing tools for batch
- Replies: 27
- Views: 22851
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...