Search found 391 matches
- 04 Nov 2010 09:55
- Forum: DOS Batch Forum
- Topic: OS and architecture
- Replies: 4
- Views: 6966
Re: OS and architecture
Nice. But I want the OS architecture -- not the physical architecture. It's for assigning registry values. I need to distinguish between using the HKLM\Software directly or using HKLM\Software\WOW6432Node. Right now I'm using: :: onlyWin7 and noWin7 identify Windows 7 machines. set onlyWin7=rem ver|...
- 03 Nov 2010 13:11
- Forum: DOS Batch Forum
- Topic: OS and architecture
- Replies: 4
- Views: 6966
OS and architecture
Anyone know of a little utility or something that can reliably/easily determine OS and architecture? I would only care about win 2000 server, XP, and newer. Here's something that I think would not be completely reliable: m Most notably, %processor_architecture% will show x86 if you're using the wow6...
- 25 Aug 2010 10:29
- Forum: DOS Batch Forum
- Topic: dates in a batch file
- Replies: 4
- Views: 6089
Re: dates in a batch file
xcopy /d: ??
I think that should work -- if you can figure out the correct syntax. I strongly prefer robocopy--but you'd have to install it on workstations.
I think that should work -- if you can figure out the correct syntax. I strongly prefer robocopy--but you'd have to install it on workstations.
- 25 Aug 2010 10:27
- Forum: DOS Batch Forum
- Topic: Cutting numbers off a file name
- Replies: 10
- Views: 9913
Re: Cutting numbers off a file name
Oops -- I messed up the tokens part. You'd have to specify a max. number of tokens for it to work. In this case, I think 2 would work: *untested* cd /d "d:\documents and settings\.....\test" for /f "delims=" %%i in ('dir /b *.csv') do ( for /f "tokens=1,2 delims=0123456789&q...
- 23 Aug 2010 11:17
- Forum: DOS Batch Forum
- Topic: Cutting numbers off a file name
- Replies: 10
- Views: 9913
Re: Cutting numbers off a file name
First, get rid of the "@"'s and turn echo on and see what it's trying to do. Second, I'm not sure that the first for loop works with embedded double quotes. (But I'm not sure -- I've never tried the way you have it.) I would do: *untested* cd /d "d:\documents and settings\.....\test&q...
- 10 Aug 2010 11:43
- Forum: DOS Batch Forum
- Topic: can not execute --launcher in batch
- Replies: 6
- Views: 6536
Re: can not execute --launcher in batch
Post your code so we can inspect it. You may be defining switch incorrectly, or you may be calling it from inside a for loop or if statment . . .
- 10 Aug 2010 11:40
- Forum: DOS Batch Forum
- Topic: how to print previous date
- Replies: 17
- Views: 18568
Re: how to print previous date
aGerman -- not sure about languages nor OS versions, but here's a trick for (XP English)regional settings: for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('"echo.|date"') do ( for /f "tokens=1-3 delims=/.- " %%A in ("%Date:* =%") do ( set %%a=%%A&set %%b=%%B...
- 06 Aug 2010 11:02
- Forum: DOS Batch Forum
- Topic: Set variable depends on if
- Replies: 2
- Views: 4010
Re: Set variable depends on if
All variables inside the parentheses will be evaluated at the time the entire block of code is called -- NOT after the variables' values are changed. Classic reason to use delayedexpansion: @ECHO OFF setlocal enabledelayedexpansion SET AA=****************** SET C1=THIS IS THE RIGHT LINE SET C3=........
- 06 Aug 2010 10:58
- Forum: DOS Batch Forum
- Topic: Output problem
- Replies: 4
- Views: 5453
Re: Output problem
If it's not too long then basically instead of echo'ing the stuff into the file one line at a time -- use a set command to append the stuff onto a variable and then echo that variable into the file. I *think* it would be these lines: for /f "tokens=2,3 delims==" %%a in (%foolist%) do set f...
- 02 Aug 2010 10:49
- Forum: DOS Batch Forum
- Topic: Get only first row for each file
- Replies: 10
- Views: 13769
Re: Get only first row for each file
Unlike the first 2 ideas, this code *should* process faster as it will only process the first line of the file and then continue on to the next file (instead of looping through the entire file just to get the first line). I can't comment on aGerman's code, since I frankly haven't figured out how it ...
- 02 Aug 2010 10:38
- Forum: DOS Batch Forum
- Topic: Need help with a Script
- Replies: 1
- Views: 3320
Re: Need help with a Script
set a = something That includes a space in the name of the variable: echo %a% is nothing. echo %a % is something So change to set /p a= with no space before or after the "a" Later: if %a%==%1% is referencing a variable named "1". I believe you want: if "%a%"=="1&qu...
- 28 Jul 2010 10:41
- Forum: DOS Batch Forum
- Topic: Automate a list of manual task - please advice
- Replies: 1
- Views: 3392
Re: Automate a list of manual task - please advice
I would create the .cmd file and then add it to a login script. Not completely automated, but you just need to login to those 100 computers and let the script run. Looks like you've already got most of the commands you'd need for a .cmd file. removing software -- you can probably use msiexec /x to u...
- 16 Jul 2010 12:26
- Forum: DOS Batch Forum
- Topic: ISQL help in DOS
- Replies: 7
- Views: 7709
Re: ISQL help in DOS
Perhaps slightly more efficient than aGerman: If you're CERTAIN that it's on line 3, then: for /f "skip=2 usebackq delims=" %%a in ("d:\apps\cat\dat\cit_date.dat") do set "yourVar=%%a"&goto continue :continue echo yourvar=%yourvar% The "&goto continue"...
- 16 Jul 2010 12:19
- Forum: DOS Batch Forum
- Topic: Time Stamping Batch File
- Replies: 8
- Views: 9641
Re: Time Stamping Batch File
If you have the ability to use a network program for monitoring --
spiceworks.com
spiceworks.com
- 14 Jul 2010 11:03
- Forum: DOS Batch Forum
- Topic: Need help w/ Recycler.bat
- Replies: 6
- Views: 6636
Re: Need help w/ Recycler.bat
Also, since %temp% could include spaces:
start "" "%temp%\results.vbs"
start "" "%temp%\results.vbs"