Meditech NPR Reports / NPR Report Writing / NPR Report Writer / Meditech NPR / Non-Procedural Report / Meditech Consulting / Meditech Reports Windows Scripting

Friday, December 19, 2008

Batch - Loop Thru Lines in File

for /f %%a in (C:\TEST.TXT) do echo %%a

Friday, November 28, 2008

Troubleshooting a Scheduled Batch File

A batch file Xcopy File With Time Stamp I'd scheduled using the Windows Scheduler wasn't executing.

The file was scheduled as:

C:\WINDOWS\system32\cmd.exe /c
C:\Program Files\SummitHealthcare\ScriptingToolkit\Debug_Log_Copy.bat

Using the cmd.exe /k switch kept the cmd console open where I identified the issue. The space in 'Program Files' was causing the problem. Encapsulating the 'Program Files' directory in quotes resolved the problem:

C:\WINDOWS\system32\cmd.exe /c
C:\"Program Files"\SummitHealthcare\ScriptingToolkit\Debug_Log_Copy.bat

Monday, November 24, 2008

Xcopy File With Time Stamp

TITLE Archive Debug File
COLOR F
@ECHO OFF
::
:: Purpose:Archive Debug File
:: Author: John Sharpe
:: Date: November 24th, 2008
:: Intent: Provide better customer service in less time.
::
cls
%systemdrive%
cd
cls
for /f "tokens=1,2 delims=: " %%a in ('time /t') do set systime=%%a%%b
for /f "tokens=2,3,4 delims=-/ " %%d in ('date /t') do set sysdate=%%d%%e%%f
set fileorig="C:\Program Files\SummitHealthcare\ScriptingToolkit\Debug_Script.txt"
set fpcopyto=C:\Downloads\CMAXX\Logs\Debug_Script
set fpcopyto=%fpcopyto%_%sysdate%_%systime%
set fpcopyto=%fpcopyto%.log
echo. f|xcopy %fileorig% %fpcopyto%
exit

Wednesday, November 12, 2008

Windows XP Kill (taskkill.exe)

cmd.exe /c taskkill /IM summitstreambuilder.exe

Friday, November 09, 2007

Keep Windows Machine Awake (Citrix)

:KeepAwake
cd\
cls
TIME /T > "%userprofile%"\desktop\KeepAwakeLog.txt
TYPE "%userprofile%"\desktop\KeepAwakeLog.txt
SLEEP 60
start cmd /c "sleep 1 & exit"
@GoTo :KeepAwake

Thursday, May 31, 2007

Batch File: Clear Desktop (WinNT.X)

:: Get to your system drive, I've hardcoded c:.
c:
:: Change directories to your desktop.
cd "%userprofile%"\desktop\
:: Create a directory to store stuff for later.
mkdir "%userprofile%"\desktop\ReviewCullDesktop\
:: Move all files to this folder.
move /y *.* "%userprofile%"\desktop\ReviewCullDesktop\
:: Change over to this destination folder and put your shortcuts back.
cd "%userprofile%"\desktop\ReviewCullDesktop\
move /y *.rdp "%userprofile%"\desktop\
move /y *.lnk "%userprofile%"\desktop\

Thursday, May 24, 2007

VB Law

http://www.visibleprogress.com/screenshot_ws.htm

Wednesday, May 23, 2007

Batch: Hack to change file extension.

for %f IN (*.tmp) DO echo. f|xcopy %f %f.txt & del %f

Tuesday, May 15, 2007

VB6 Contains - InStr

Quick and easy VB6 way to determine whether the string ERX is in the strInBuffer.

If InStr(strInBuffer, "ERX") <> 0 Then
strMessage = ""
End If

Monday, May 14, 2007

VB6 Hang or Pause for X Seconds

Private Sub Hang(sngSeconds As Single)
Dim sngTimeOut As Single
sngTimeOut = Timer + sngSeconds
DoEvents
Do Until Timer >= sngTimeOut
Loop
End Sub

Meditech NPR Reports / NPR Report Writing / NPR Report Writer / Meditech NPR / Non-Procedural Report / Meditech Consulting / Meditech Reports