Jump to content

Help me to redirect to a file any errors from my batch.


Recommended Posts

Hi all. I have a batch file which runs from GuiRunOnce during the first logon. This script is long and makes many things (installations, copy, delete etc), so I want to redirect to a log file any error messages (eg from a failed copy or delete command), because I need the output for troubleshooting purposes. Now I am trying to note down any errors I see, but I haven't the time needed (as the script is being executed quickly) and I don't want to add any pause or sleep commands in it. I read a lot in the net about redirection (stderr stream) but strangely nothing works for me! Whatever I type in the run box (eg C:\a_script_with_errors.cmd 2>Errors.log), either ALL the output will go to the screen or to the log file. What I want is to be able to see my echo messages (and other commands, eg "1 file copied") on the screen and only any erros to be logged. Is this possible under Windows XP? Which is the correct syntax I should use under GuiRunOnce section in Winnt.sif? Now I have written "%systemdrive%\Installations.cmd 2>> C:\Error.log" (without quotes) but I think that it won't work. Of course, the ideal would be to have all the output (with errors) both on my screen and in a log file, but I think that this is impossible with common dos commands. But maybe a specific utility can make it...

Irrelevant: Is it possible to disable the press F6 and F2 messages from my unattended CD? I have all the necessary drivers and I would like to reduce the text mode portion by 10 seconds. Thank you.

Link to comment
Share on other sites


Have you thought about using a VBS script that checks things and makes the reports.

Example This Checks For C:\Test.txt then copies it top D:\Test.txt

This script reports if it was successful or not successfull.

Const OverwriteExisting = TRUE
Dim Fso,Act,Report_Log,Ts
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Act = CreateObject("Wscript.Shell")
Report_Log = Act.ExpandEnvironmentStrings("%Systemdrive%\Report_UaInstall.log")
'''' OPEN THE REPORT_UAINSTALL.LOG
Set Ts = Fso.CreateTextFile(Report_Log)
Ts.WriteLine Now() & Space(5) & Act.ExpandEnvironmentStrings("%Username%") & vbCrLf & "Preparing To Copy C:\Test.txt To D:\"
If Fso.FileExists("C:\Test.txt") Then
Fso.CopyFile "C:\Test.txt" , "D:\" , OverwriteExisting
Ts.WriteLine "Confirm Copy Completed"
Else
Ts.WriteLine "Copy File Error" & vbTab & "C:\Test.txt" & vbTab & "Was Not Found"
End If
Ts.Close

If you want help with the vbs script post the cmd script and I will try and do it so they both work together.

Link to comment
Share on other sites

Hi again. Thanks for your answers. The "mybat.cmd 2>errors.txt" doesn't work, at least from the Run command box. So I think that it will not work during the first logon. What it does is to create the errors.txt file which is empty though and display on the screen both the output (in my case an echo message) and the error (in my test.cmd the error is "The system cannot find the file specified"). But I want the error messages to be (only or even better also) in the file. As I said, I have searched the net and tried many different combinations with >>, 2> or 2>&1, but none of them work. I believe that maybe the ability to redirect only the stderr is not supported in Windows XP.

As for the .vbs, I am a new scripter and I don't know this language. So I prefer to keep things simple and use some standard commands and methods. The only .vbs I have made is for closing some windows which opens at the end of some silent installations (AppActivate, SendKeys etc). But if you want to explain me the logic of your method it is welcome.

Link to comment
Share on other sites

Ok I found a Cmd Script I made a while ago it output the error you will have to edit to match your needs

Just run this with out editing and on your desktop look for this file R1TestLog.txt

I just prefer using VBS is all.

echo off && Cls && Mode 69,3 && Color 5e

:: REMOVE THE :: IF YOU ARE INSTALLING FROM A CD OR DVD DRIVE

::for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i

set P2=Ping -n 2 127.0.0.1

set P3=Ping -n 3 127.0.0.1

set P4=Ping -n 4 127.0.0.1

::REMOVE THE :: IF YOU ARE INSTALLING FROM A CD OR DVD DRIVE

::set TEST=%cdrom%\Apps

:: ADD :: IF TO THE BELOW LINE IF YOU ARE INSTALLING FROM CD OR DVD DRIVE

set TEST=%Systemdrive%\Apps

set TEST1=%TEST%\Cleanup.cmd

set TEST2=%TEST%\ACEMCP591\ACEMCP591PRO.EXE

set TEST3=%TEST%\Alcohol\AlcoholInstall.cmd

set TEST4=%TEST%\Flash\FlsPlyr7Install.cmd

set TEST5=%TEST%\Winamp\WinAmpInstall.cmd

set Name1=Cleanup.cmd

set Name2=AcePro591Install.cmd

set Name3=AlcoholInstall.cmd

set Name4=FlsPlyr7Install.cmd

set Name5=WinAmpInstall.cmd

set TESTLOG="%UserProfile%\DESKTOP\R1TestLog.txt"

::Set M=Missing-^>

Set Proc=Processing..

Set Line=:------------------------------------------------------------------:

for /f "Tokens=*" %%i in ('time /t') do set TIMET=%%i

for /f "Tokens=*" %%i in ('date /t') do set DATET=%%i

for /f "Tokens=*" %%i in ('ver') do set V=%%i

TITLE START CHECK 1

cls && Color f1

%P3%>nul | Echo Preparing Test Your RunOnceEx.cmd

::::::::::::::::CHECK FOR FILE 001 IN YOUR RUNONCE

TITLE CHECK %TEST1%

CLS && COLOR F9

:CHECK1

If Exist %TEST1% Echo %Proc% %Name1% && %P3%>nul && Goto :Next1B

If Not Exist %TEST1% %Proc% %Name1% && %P3%>nul && Goto :Missing1

:Missing1

TITLE Missing %Name1%

CLS && COLOR FC

::If Exist %TESTLOG% Del /s /q %TESTLOG%

echo.

echo %Line% > %TESTLOG%

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name1% Is Missing...!!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo -^> This File : %Name1% Is Missing...!!! && %P3%>nul && goto :Next1a

goto EOF

:Next1a

TITLE Failed %Name1%

CLS && COLOR 2F

echo.

Echo -^> %Name1% Failed Preparing Check %Name2% && %P3%>nul && GOTO :CHECK2

goto EOF

:Next1b

TITLE Passed %Name1%

CLS && COLOR 3F

::If Exist %TESTLOG% Del /s /q %TESTLOG%

echo.

echo %Line% > %TESTLOG%

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name1% Has Passed....!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo This File : %Name1% Has Passed....!! && %P3%>nul && GOTO :CHECK2

goto EOF

::::::::::::::::CHECK FOR FILE 001 IN YOUR RUNONCE

::::::::::::::::CHECK FOR FILE 002 IN YOUR RUNONCE

:CHECK2

TITLE CHECK %TEST2%

CLS && COLOR 4F

if Exist %TEST2% echo %Proc% %Name2% && %P3%>nul && Goto Next2

If not Exist %TEST2% Echo %Proc% %Name2% && %P3%>nul && Goto Missing2

:Next2

TITLE Passed %Name2%

CLS && COLOR 6F

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name2% Has Passed....!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo This File : %Name2% Has Passed....!! && %P3%>nul && goto :CHECK3

goto EOF

:Missing2

TITLE Missing %Name2%

CLS && COLOR FC

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name2% Is Missing...!!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo -^> This File : %Name2% Is Missing...!!! && %P2%>nul && goto :Next2a

goto EOF

:Next2a

TITLE Failed %Name2%

CLS && COLOR 2F

echo.

Echo -^> %Name2% Failed Preparing Check %Name3% && %P3%>nul && GOTO :CHECK3

goto EOF

::::::::::::::::CHECK FOR FILE 002 IN YOUR RUNONCE

::::::::::::::::CHECK FOR FILE 003 IN YOUR RUNONCE

:CHECK3

TITLE CHECK %TEST3%

CLS && COLOR 5F

if Exist %TEST3% echo %Proc% %Name3% && %P3%>nul && Goto :Next3

If not Exist %TEST3% Echo %Proc% %Name3% && %P3%>nul && Goto :Missing3

:Next3

TITLE Passed %Name3%

CLS && COLOR 6F

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name3% Has Passed....!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo This File : %Name3% Has Passed....!! && %P3%>nul && goto :CHECK4

goto EOF

:Missing3

TITLE Missing %Name3%

CLS && COLOR FC

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name3% Is Missing...!!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo The %Name3% Is Missing...!!! && %P3%>nul && goto :Next3a

goto EOF

:Next3a

TITLE Failed %Name3%

CLS && COLOR 2F

echo.

Echo -^> %Name3% Failed Preparing Check %Name4% && %P3%>nul && GOTO :CHECK4

goto EOF

::::::::::::::::CHECK FOR FILE 003 IN YOUR RUNONCE

::::::::::::::::CHECK FOR FILE 004 IN YOUR RUNONCE

:CHECK4

TITLE CHECK %TEST4%

CLS && COLOR 5F

if Exist %TEST4% echo %Proc% %Name4% && %P3%>nul && Goto Next4

If not Exist %TEST4% Echo %Proc% %Name4% && %P3%>nul && Goto Missing4

:Next4

TITLE Passed %Name4%

CLS && COLOR 6F

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name4% Has Passed....!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo This File : %Name4% Has Passed....!! && %P3%>nul && goto CHECK5

goto EOF

:Missing4

TITLE Missing %Name4%

CLS && COLOR FC

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name4% Is Missing...!!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo The %Name4% Is Missing!!!! && %P3%>nul && goto :Next4a

goto EOF

:Next4a

TITLE Failed %Name4%

CLS && COLOR 2F

echo.

Echo -^> %Name4% Failed Preparing Check %Name5% && %P3%>nul && GOTO :CHECK5

goto EOF

::::::::::::::::CHECK FOR FILE 004 IN YOUR RUNONCE

::::::::::::::::CHECK FOR FILE 005 IN YOUR RUNONCE

:CHECK5

TITLE CHECK %TEST5%

CLS && COLOR 5F

if Exist %TEST5% echo %Proc% %Name5% && %P3%>nul && Goto Next5

If not Exist %TEST5% Echo %Proc% %Name5% && %P3%>nul && Goto Missing5

:Next5

TITLE Passed %Name5%

CLS && COLOR 6F

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name5% Has Passed....!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo This File : %Name5% Has Passed....!! && %P3%>nul && goto quit

goto EOF

:Missing5

TITLE Missing %Name5%

CLS && COLOR FC

echo.

echo %Line% >> %TESTLOG%

echo %datet% %timet% : %Name5% Is Missing...!!! >> %TESTLOG%

echo Windows Version : %V% >> %TESTLOG%

echo %Line% >> %TESTLOG%

echo %Line% >> %TESTLOG%

Echo The %Name5% Is Missing!!!! && %P3%>nul && goto :Next5a

goto EOF

:Next5a

TITLE Failed %Name4%

CLS && COLOR 2F

echo.

Echo -^> %Name4% Failed Preparing Check %Name5% && %P3%>nul && GOTO :quit

goto EOF

::::::::::::::::CHECK FOR FILE 005 IN YOUR RUNONCE

:quit

TITLE Gsm Good Bye!

CLS && COLOR F1

echo.

Echo Gsm RunOnceEx Test Completed && %P4%>nul

exit

The logic is I could make a far smaller script then the above.

VBS Script of the same cmd file

Dim Act, ChkCmd, Dtop, Fso, Line,Report_R1, SD, strChkCmd, Ts
Set Act = CreateObject("Wscript.Shell")
Set Fso = CreateObject("Scripting.FileSystemObject")
SD = Act.ExpandEnvironmentStrings("%Systemdrive%\Apps")
Dtop = Act.SpecialFolders("Desktop")
Report_R1 = Dtop & "\R1_Instal.log"
Line = Chr(171) & " ---------------------------------- " & Chr(187)
Set Ts = Fso.OpenTextFile(Report_R1,2,True)
ChkCmd = Array(SD & "\ACEMCP591\ACEMCP591PRO.EXE",SD & "\Alcohol\AlcoholInstall.cmd",_
SD & "\Cleanup.cmd",SD & "\Flash\FlsPlyr7Install.cmd",SD & "\Winamp\WinAmpInstall.cmd")

For Each strChkCmd In ChkCmd
If Fso.FileExists(strChkCmd)Then
Act.Popup "Confirm File" & vbCrLf & strChkCmd,3,"Confirm", 0 + 32
Ts.WriteLine "Confirm This File Was There" & vbCrLf & strChkCmd & vbCrLf & "Install Started At : " & Now() & vbCrLf & Line
'''' UNCOMMENT THE BELOW LINE TO MAKE ACTIVE
'' Act.Run(strChkCmd),1,True
Else
Act.Popup "Error Missing File" & vbCrLf & strChkCmd,3,"Missing", 0 + 32
Ts.WriteLine "Cannot find This File" & vbCrLf & strChkCmd & vbCrLf & "Error Time And Date : " & Now() & vbCrLf & Line
End If
Next

Ts.Close
Act.Run(Chr(34) & Report_R1 & Chr(34)),1,False

Edited by gunsmokingman
Link to comment
Share on other sites

Just for the record:

somebat.cmd > mylog.txt
Will REPLACE the contents of mylog.txt with the output of the command somebat.cmd, i.e. if the somebat.cmd has multiple output and the last one is an empty line, the resulting mylog.txt will be EMPTY.
somebat.cmd >> mylog.txt

Will APPEND to the contents of mylog.txt the output of the command somebat.cmd, i.e. if the somebat.cmd has multiple output and the last one is an empty line, the resulting mylog.txt will be a log of all outputs + an empty line.

What you need to log is "standard output", NOT "standard error":

http://www.robvanderwoude.com/redirection.html

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Hi all. Thank you for your support. Here is my feedback after a real format: I am using the line "%systemdrive%\Installations.cmd 2>%systemdrive%\Errors.log" (quotes are necessary) under [GuiRunOnce] section of Winnt.sif and I have the result I want. During the first logon, I can see the real-time output of Installations.cmd in the command prompt, except from any errors that are being logged to the Errors.log. Indeed, after the load of the shell, I can see this file in my C:\ (systemdrive) which does have the error messages only. Jaclaz, if I use your commands, I will redirect the standard output so I won't be able to see the progress of my installations. I want only the errors from my batch to be logged in the Errors.log file for troubleshooting purposes.

What is really strange is this: When I was making some tests from the run box with the command "test.cmd 2>Errors.log", I was using a copy command in it to copy a non-existent file. Despite the 2> operator, the created error "The system cannot find the file specified" was displaying to the command prompt window and not to the destination file (errors.log), which was empty. When I decided to add more errors in my test.cmd ("ech Hi all" and "del C:\yo.rm"), I ascertained that these error messages was not being displayed in the prompt but in the errors.log ('ech' is not recognized as an internal or external command, operable program or batch file. Could Not Find C:\yo.rm). So I understood that my syntax was correct, the file was being created and it was recording the errors normally, except from the error with the copy command. This screw-up made me to post here and now I know that Jbm's reply was correct. As I said, during the first logon at my real windows setup, the command worked great and redirected the standard error stream to the Errors.log file. Under those circumstances, the error message "The system cannot find the file specified" is normally being logged in my log file. I can't understand why it's not the same from the run box.

Link to comment
Share on other sites

The output about not finding the file isn't stderr, therefore it is not redirected as such.

I can copy what the guy below me has written without error, however since he hasn't written anything yet, I am not given the opportunity to do so, it is not my copying that therefore has an error.

As the message stated, it cannot find the file, it is the finding which is the problem not the copying. This leads me to an obvious response, fix your coding to prevent these eventualities first.

IF EXIST "E:\To Be Copied\A File.ext" COPY "E:\To Be Copied\A File.ext" "G:\Somewhere Else"2>NUL

<Edit>

I have used NUL, whereas you would obviously use your chosen file, and possibly, depending upon your requirements, append, (>>).

</Edit>

Edited by Yzöwl
Link to comment
Share on other sites

Hi all. Jaclaz, I think that this tee command is very useful, but I can't get it worked. As I said, the best solution would be to copy everything both in the screen and in a log file. Can you please help me with the syntax? Give me a real example if you can. I am using this simple .cmd but no log file creation. I get the "file not found" error, after the dir results and if I create myself an empty mylog.log file, it keeps to be empty after the batch execution. Keep in mind that I am a new scripter. I have installed the GNUwin32 package and copied the tee.exe into system32. The description of the command didn't help me.

@echo off

dir F:\ ¦ tee -a C:\mylog.log

sleep 5

EXIT

Yzowl, I understood that when the system cannot find a file to copy (or whatever), it's not a stderr but a stdout. That's why when I run my test.cmd from run box I see this message in the command prompt and not in the log. But why during the execution of my script (GuiRunOnce) these messages were being logged in my errors.log? I had 3 lines with the error "The system cannot find the file specified". Also, what I gain if I use the "if exist" command? I tried it and find out that the message "The system cannot find the file specified" is not displayed anywhere. The good point whould be to have a log entry: "The file E:\To Be Copied\A File.ext doesn't exist". So I would know that I have to put that file there. If I use this method, I won't even know about any errors. Here is my test.cmd:

@echo off

Echo ready for the step one.

if exist "C:\yo.rm" COPY "C:\yo.rm" "F:\" 2>errors.log

sleep 5

EXIT

Link to comment
Share on other sites

Hi. Gunsmokingman, can you help me with this script? It is just for closing the "Found new hardware" wizard during Alcohol 120% installation. I want to run Alcohol195.exe from my CD (from the same folder as .vbs) like all the other applications. But if I use the WshShell.Run ("Alcohol195.exe"), it pops-up an error in line 2 (during the first logon from GuiRunOnce) saying that the system cannot find the file. Now I put the exe in my systemdrive (using $OEM$) and I use the following syntax.

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run ("%systemdrive%\Alcohol195.exe")

WScript.Sleep 8000

WshShell.SendKeys "{DOWN}"

WScript.Sleep 300

WshShell.SendKeys "{TAB}"

WScript.Sleep 300

WshShell.SendKeys "{ENTER}"

WScript.Sleep 300

WshShell.SendKeys "{TAB}"

WScript.Sleep 300

WshShell.SendKeys " "

WScript.Sleep 300

WshShell.SendKeys "{TAB}"

WScript.Sleep 300

WshShell.SendKeys "{TAB}"

WScript.Sleep 300

WshShell.SendKeys "{TAB}"

WScript.Sleep 300

WshShell.SendKeys "{ENTER}"

WScript.Sleep 2000

WshShell.SendKeys "{ENTER}"

WScript.Quit

The strange is that if I use the WshShell.Run ("Alcohol195.exe") command from the HDD (both .exe and .vbs in C:\), it starts the installation normally. Can you help me? Maybe this is the correct syntax: WshShell.Run (".\Alcohol195.exe")? Is there any way to convert the following code to .vbs, so I can use the %cdrom% variable in the .vbs and give a full path? Thanks.

set tagfile=\WIN51

for %%i in (c d e f g h) do if exist "%%i:%tagfile%" set cdrom=%%i:

Link to comment
Share on other sites

What this script does

Checks to see if if CD or DVD drive

Checks to see if the CD or DVD has something in it

Then it checks for this file

"CD_DVD_DRIVE:\Apps\Alcohol120\setup.msi"

Then it start the install

If it cannot find the file then it waits for you to place the correct Disk in the drive. It will loop 6 times for a total of 60 seconds. Then it self closes. This script can be ran from any where on the local computer.

Save as InstallAlcohol120.vbs

To edit this vbs script

":\Apps\Alcohol120\setup.msi" change this color text to what you need

this change the file it looks for.

" /qb /norestart" and change this to what you need

Dim Act, Cmd1, Fso, Drv, strDrive,CT : CT = 0

Set Act = CreateObject("Wscript.shell")

Set Fso = CreateObject("Scripting.FileSystemObject")

Cmd1 = ":\Apps\Alcohol120\setup.msi"

Alcohol120

Function Alcohol120

Do

CT = CT + 1

Set Drv = Fso.Drives

For Each strDrive In Drv

If strDrive.DriveType = 4 Then

If strDrive.IsReady = True Then

If Fso.FileExists(strDrive.DriveLetter & Cmd1) Then

Act.Run(strDrive.DriveLetter & Cmd1 & " /qb /norestart"),1,True : WScript.Quit

End If

Else

If strDrive.IsReady = False Then

ZZ1 = Act.Popup ("The CD Or DVD Does Not Appear Ready" & vbCrLf & strDrive.DriveLetter & ":\" &_

vbCrLf & "Ok to contiue" & vbTab & "Cancel to quit", 10,"Continue Or Quit : " & CT, 5 + 48)

If ZZ1 = vbretry Then : End If

If ZZ1 = vbcancel Then : WScript.Quit : End If

If ZZ1 = -1 Then : End If

If CT = 6 Then : Act.Popup "The defualt time occur preparing to stop script", 5,"Time out Error", 0 + 32 : WScript.Quit : End If

End If

End If

End If

Next

Loop Until CT = 6

End Function

I use alcolhol 120 and I use the msi instaed of the exe

Edited by gunsmokingman
Link to comment
Share on other sites

Hi. Gunsmokingman, can you help me with this script? It is just for closing the "Found new hardware" wizard during Alcohol 120% installation. I want to run Alcohol195.exe from my CD (from the same folder as .vbs) like all the other applications. But if I use the WshShell.Run ("Alcohol195.exe"), it pops-up an error in line 2 (during the first logon from GuiRunOnce) saying that the system cannot find the file. Now I put the exe in my systemdrive (using $OEM$) and I use the following syntax.

The strange is that if I use the WshShell.Run ("Alcohol195.exe") command from the HDD (both .exe and .vbs in C:\), it starts the installation normally.

If you manually start a VBS from where it is, then it's working directory is where it is. Executing from the registry, usually means that the systemdrive is the working directory, so it is not strange for your script to fail.

This is what I would try

Set WshShell = WScript.CreateObject("WScript.Shell")
Dim ScriptFullPath
ScriptFullPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
if WshShell.CurrentDirectory <> ScriptFullPath Then
WshShell.CurrentDirectory = ScriptFullPath
end if
WshShell.Run ("Alcohol195.exe")
WScript.Sleep 8000
WshShell.SendKeys "{DOWN}"
WScript.Sleep 300
WshShell.SendKeys "{TAB}"
WScript.Sleep 300
WshShell.SendKeys "{ENTER}"
WScript.Sleep 300
WshShell.SendKeys "{TAB}"
WScript.Sleep 300
WshShell.SendKeys " "
WScript.Sleep 300
WshShell.SendKeys "{TAB}"
WScript.Sleep 300
WshShell.SendKeys "{TAB}"
WScript.Sleep 300
WshShell.SendKeys "{TAB}"
WScript.Sleep 300
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WScript.Quit

Link to comment
Share on other sites

har-vas

Try using this other version of tee:

http://www.csc.calpoly.edu/~bfriesen/software/console.shtml

http://www.csc.calpoly.edu/~bfriesen/softw...files/tee32.zip

Tee32 3.2 Copyright 2002 Brian Friesen

Usage:

<command> | tee <filename> [/A]Splits output such that it goes to both <filename> and the screen.

/A appends to the file

This is the one I use, in the other post I forgot to put the link to it...

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...