@echo off setLocal EnableDelayedExpansion cd C:\Decryptor set N=1 for /F "delims=" %%a in (C:\temp\recordings.txt) do ( encryptwave-w32r-1-1.exe -d "%%a" -o "C:\recordings\recording!N!.wav" set /A N+=1 )
@echo off
setLocal EnableDelayedExpansion
cd C:\Decryptor
set N=1
for /F “delims=” %%a in (C:\temp\recordings.txt) do (
encryptwave-w32r-1-1.exe -d “%%a” -o “C:\recordings\recording!N!.wav”
set /A N+=1
)
Expect is a recent addition to windows thanks to the very hard work of the Tcl Core group. I'd suggest that you comment out the chmod +x based on an env check for platform type. Please see the documentation for your proposed platform for what tcl's native 'file attributes' supports. After a brief stRead more
Expect is a recent addition to windows thanks to the very hard work of the Tcl Core group.
I’d suggest that you comment out the chmod +x based on an env check for platform type. Please see the documentation for your proposed platform for what tcl’s native ‘file attributes’ supports.
After a brief study of the script all the rest seems tcl safe cross-platform, though some breakage may be incurred with unsupported options for expect core commands under windows.
::@echo off ::set /a money=100 ::start ::presuming that a taco costs one unit of money ::echo Press 1 for a taco ::set /p item= ::if %money% lss 1 echo you do not have enough money && goto start ::set /a money=money-1 ::show ::echo %money% ::pause ::another other choice would be to assign eaRead more
::@echo off
::set /a money=100
::start
::presuming that a taco costs one unit of money
::echo Press 1 for a taco
::set /p item=
::if %money% lss 1 echo you do not have enough money && goto start
::set /a money=money-1
::show
::echo %money%
::pause
::another other choice would be to assign each item of food an amount and compare variables.
@echo off
set /a money=100
:start
::presuming that a taco costs one unit of money
echo you may select the following items: taco : sprite : chicken
set /a taco=1
set /a sprite=2
set /a chicken=3
set /p item=”please type what you want: ”
set /a item=%item%
set /a cost=item
if %money% lss %cost% echo you do not have enough money && goto start
set /a money=money-item
:show
echo %money%
pause
goto start
Replace if %choice%==turn on light switch goto correct1 with if "%choice%"=="turn on light switch" goto correct1 A string with spaces must be enclosed by double quotes. This is the cause of your error while what M2 says is anyway right.
Replace
if %choice%==turn on light switch goto correct1
with
if “%choice%”==”turn on light switch” goto correct1
A string with spaces must be enclosed by double quotes. This is the cause of your error while what M2 says is anyway right.
With CreateObject(“Scripting.FileSystemObject”)
Set inFile = .OpenTextFile(inFilePath)
Set outFile = .OpenTextFile(outFilePath, 2, True)
End With
outFile.WriteLine inFile.ReadLine
outFile.Write inFile.ReadLine
WARNING: batch script not tested. @echo off & setlocal EnableDelayedExpansion cd /D E:\images for %%j in (*.jpg) do ( set fname=%%~nj set fname=!fname:*_=! if not exist !fname! md !fname! move %%j !fname! )
WARNING: batch script not tested.
@echo off & setlocal EnableDelayedExpansion
cd /D E:\images
for %%j in (*.jpg) do (
set fname=%%~nj
set fname=!fname:*_=!
if not exist !fname! md !fname!
move %%j !fname!
)
Well then, I might as well use a version that works with batch scripts: Set fso = CreateObject("Scripting.FileSystemObject") Set Win = New RegExp : Win.Pattern = "\r\n" Set Unix = New RegExp : Unix.Pattern = "[^\r]\n" For Each arg In WScript.Arguments file = fso.OpenTextFile(arg).ReadAll If Win.TestRead more
Well then, I might as well use a version that works with batch scripts:
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set Win = New RegExp : Win.Pattern = “\r\n”
Set Unix = New RegExp : Unix.Pattern = “[^\r]\n”
For Each arg In WScript.Arguments
file = fso.OpenTextFile(arg).ReadAll
If Win.Test(file) Then
EOL = “=Win32”
ElseIf Unix.Test(file) Then
EOL = “=UNIX”
Else
EOL = “=Unknown”
End If
WScript.Echo fso.GetFileName(arg) & EOL
Next ‘arg
Usage (assuming you called the script checkEOL.vbs):
cscript //nologo checkEOL.vbs
Try =ADDRESS(ROW(cell_name),COLUMN(cell_name)). A cell w/ the above formula will display $B$5, for example. See Excel help for more info on usage/syntax, esp. the helpful abs_num option: ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text]) In Excel 2007, there's a name manager that you can usRead more
Try =ADDRESS(ROW(cell_name),COLUMN(cell_name)).
A cell w/ the above formula will display $B$5, for example.
See Excel help for more info on usage/syntax, esp. the helpful abs_num option:
ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text])
In Excel 2007, there’s a name manager that you can use to assign cell or range names. You can also select a cell or range of cells & then right click, & select “Name a Range…”.
If IsNull(oRetStatus.StatusCode) Or oRetStatus.StatusCode <> 0 Then sPing = False Else sPing = True End IfNote: This can be rewritten as: sPing = oRetStatus.StatusCode = 0 And Not IsNull(oRetStatus.StatusCode)Function sPing(sHost) As StringAlso, you're returning a Boolean, so you should probabRead more
If IsNull(oRetStatus.StatusCode) Or oRetStatus.StatusCode <> 0 Then
sPing = False
Else
sPing = True
End If
Note: This can be rewritten as:
sPing = oRetStatus.StatusCode = 0 And Not IsNull(oRetStatus.StatusCode)
Function sPing(sHost) As String
Also, you’re returning a Boolean, so you should probably fix your function deceleration.
Bad: This WMI class is not publicly documented, so its implementation is hit and miss. If you need this to work on a number of machines, you’re left with the Windows API.
Need To Auto Incriment Filename When Saving.
@echo off setLocal EnableDelayedExpansion cd C:\Decryptor set N=1 for /F "delims=" %%a in (C:\temp\recordings.txt) do ( encryptwave-w32r-1-1.exe -d "%%a" -o "C:\recordings\recording!N!.wav" set /A N+=1 )
@echo off
setLocal EnableDelayedExpansion
cd C:\Decryptor
See lessset N=1
for /F “delims=” %%a in (C:\temp\recordings.txt) do (
encryptwave-w32r-1-1.exe -d “%%a” -o “C:\recordings\recording!N!.wav”
set /A N+=1
)
How To Use Strlen() In Java.
Use: x.length() rather than strlen.
Use:
x.length()
rather than strlen.
See lessHow To Run Autoexpect On Windows?
Expect is a recent addition to windows thanks to the very hard work of the Tcl Core group. I'd suggest that you comment out the chmod +x based on an env check for platform type. Please see the documentation for your proposed platform for what tcl's native 'file attributes' supports. After a brief stRead more
Expect is a recent addition to windows thanks to the very hard work of the Tcl Core group.
I’d suggest that you comment out the chmod +x based on an env check for platform type. Please see the documentation for your proposed platform for what tcl’s native ‘file attributes’ supports.
After a brief study of the script all the rest seems tcl safe cross-platform, though some breakage may be incurred with unsupported options for expect core commands under windows.
See lessHow Do I Make A Money System For A Batch RPG?
::@echo off ::set /a money=100 ::start ::presuming that a taco costs one unit of money ::echo Press 1 for a taco ::set /p item= ::if %money% lss 1 echo you do not have enough money && goto start ::set /a money=money-1 ::show ::echo %money% ::pause ::another other choice would be to assign eaRead more
::@echo off
::set /a money=100
::start
::presuming that a taco costs one unit of money
::echo Press 1 for a taco
::set /p item=
::if %money% lss 1 echo you do not have enough money && goto start
::set /a money=money-1
::show
::echo %money%
::pause
::another other choice would be to assign each item of food an amount and compare variables.
@echo off
set /a money=100
:start
::presuming that a taco costs one unit of money
echo you may select the following items: taco : sprite : chicken
set /a taco=1
set /a sprite=2
set /a chicken=3
set /p item=”please type what you want: ”
set /a item=%item%
set /a cost=item
if %money% lss %cost% echo you do not have enough money && goto start
set /a money=money-item
:show
echo %money%
pause
goto start
:: mike
See lessGoto Was Unexpected At This Time.
Replace if %choice%==turn on light switch goto correct1 with if "%choice%"=="turn on light switch" goto correct1 A string with spaces must be enclosed by double quotes. This is the cause of your error while what M2 says is anyway right.
Replace
if %choice%==turn on light switch goto correct1
with
if “%choice%”==”turn on light switch” goto correct1
A string with spaces must be enclosed by double quotes. This is the cause of your error while what M2 says is anyway right.
See lessDOS Remove Linefeed And Carriage Return ?
VBScript: Const inFilePath = "something.psv" Const outFilePath = "out.psv" With CreateObject("Scripting.FileSystemObject") Set inFile = .OpenTextFile(inFilePath) Set outFile = .OpenTextFile(outFilePath, 2, True) End With outFile.WriteLine inFile.ReadLine outFile.Write inFile.ReadLine
VBScript:
Const inFilePath = “something.psv”
Const outFilePath = “out.psv”
With CreateObject(“Scripting.FileSystemObject”)
See lessSet inFile = .OpenTextFile(inFilePath)
Set outFile = .OpenTextFile(outFilePath, 2, True)
End With
outFile.WriteLine inFile.ReadLine
outFile.Write inFile.ReadLine
Batch To Move Files Based On Partial Name
WARNING: batch script not tested. @echo off & setlocal EnableDelayedExpansion cd /D E:\images for %%j in (*.jpg) do ( set fname=%%~nj set fname=!fname:*_=! if not exist !fname! md !fname! move %%j !fname! )
WARNING: batch script not tested.
@echo off & setlocal EnableDelayedExpansion
See lesscd /D E:\images
for %%j in (*.jpg) do (
set fname=%%~nj
set fname=!fname:*_=!
if not exist !fname! md !fname!
move %%j !fname!
)
Batch To Detect Unix And Windows Line Endings
Well then, I might as well use a version that works with batch scripts: Set fso = CreateObject("Scripting.FileSystemObject") Set Win = New RegExp : Win.Pattern = "\r\n" Set Unix = New RegExp : Unix.Pattern = "[^\r]\n" For Each arg In WScript.Arguments file = fso.OpenTextFile(arg).ReadAll If Win.TestRead more
Well then, I might as well use a version that works with batch scripts:
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set Win = New RegExp : Win.Pattern = “\r\n”
Set Unix = New RegExp : Unix.Pattern = “[^\r]\n”
For Each arg In WScript.Arguments
file = fso.OpenTextFile(arg).ReadAll
If Win.Test(file) Then
EOL = “=Win32”
ElseIf Unix.Test(file) Then
EOL = “=UNIX”
Else
EOL = “=Unknown”
End If
WScript.Echo fso.GetFileName(arg) & EOL
Next ‘arg
Usage (assuming you called the script checkEOL.vbs):
See lesscscript //nologo checkEOL.vbs
Using Absolute Cell Reference With INDIRECT
Try =ADDRESS(ROW(cell_name),COLUMN(cell_name)). A cell w/ the above formula will display $B$5, for example. See Excel help for more info on usage/syntax, esp. the helpful abs_num option: ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text]) In Excel 2007, there's a name manager that you can usRead more
Try =ADDRESS(ROW(cell_name),COLUMN(cell_name)).
A cell w/ the above formula will display $B$5, for example.
See Excel help for more info on usage/syntax, esp. the helpful abs_num option:
ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text])
In Excel 2007, there’s a name manager that you can use to assign cell or range names. You can also select a cell or range of cells & then right click, & select “Name a Range…”.
See lessTest Wifi Signal Strength Using Excel VBA
If IsNull(oRetStatus.StatusCode) Or oRetStatus.StatusCode <> 0 Then sPing = False Else sPing = True End IfNote: This can be rewritten as: sPing = oRetStatus.StatusCode = 0 And Not IsNull(oRetStatus.StatusCode)Function sPing(sHost) As StringAlso, you're returning a Boolean, so you should probabRead more
If IsNull(oRetStatus.StatusCode) Or oRetStatus.StatusCode <> 0 Then sPing = False Else sPing = True End IfNote: This can be rewritten as:
Also, you’re returning a Boolean, so you should probably fix your function deceleration.
Time for good news / bad news.
Good: I found a WMI class you might be able to use: http://blogs.technet.com/b/heyscrip…
Bad: This WMI class is not publicly documented, so its implementation is hit and miss. If you need this to work on a number of machines, you’re left with the Windows API.
How To Ask Questions The Smart Way