I am trying to execute a SoapUI 5.2.1 test via command line with a command like this:
C:\Program Files\SmartBear\SoapUI-5.2.1\bin\testrunner.bat -s
"TestSuite 1" -c "Test001" -M -j -f "c:\auto" -r "C:\soapui-project.xml"
Apparently, this works fine.
The problem is that the execution always prints a list of all files existing in the directory from where I am running the test.
Example:
Volume in drive C is Windows
Volume Serial Number is ABC1-2BAC
Directory of C:\Users\abc\Desktop
08/06/2017 13:55 <DIR> .
08/06/2017 13:55 <DIR> ..
21/04/2017 11:57 <DIR> folder1
26/05/2017 13:00 <DIR> file2
07/10/2016 17:24 <DIR> fileN
more files and folders ...
How can I avoid that? If I execute it from "Temp" folder, a 10 seconds test takes about 10 minutes to execute because is listing tons and tons of files.
Thank you.
After days of runs and debugs I finally figured it out.
Here's the tip:
I just removed command "dir" from the end of "C:\Program Files\SmartBear\SoapUI-5.2.1\bin\testrunner.bat" file and this solves my problem. Simple as that.
Thank you anyway.
Related
When using .logopen logfile.txt command, where is logfile.txt created? I managed to work around it by specifying absolute path, but am wondering when giving relative path where is file created?
For version 6.3.9600, WinDbg help says in .hh .logfile:
If you do not specify a path, the debugger uses the current directory.
For me, I installed WinDbg in the program files directory.
5:kd> .dbgdbg
0:025> |
. 0 id: 29fc attach name: C:\Program Files (x86)\Windows Kits\8.1\Debuggers\x86\windbg.exe
Using Process Monitor, I can see that WinDbg tries to create the logfile there (and fails for permission reasons).
When I cange the working directory in the WinDbg LNK file I use for starting it, it opens the log file in that directory.
I cannot confirm #blabbs answer, since my home directory is
5: kd> !homedir
Home directory is C:\ProgramData\dbg
in both cases (running from %ProgramFiles% and running from D:\temp). If I change !homedir, the location of .logfile is not affected.
edit
the log file is created in current directory from where windbg was invoked not in homedir i always run windbg from start run (winkey +r -> windbg) and apparently it starts windbg from the installation folder and inherits the directory as well it seems
starting windbg from different folders make the logfile be created in respective current directories
>md windbglogtestone
>cd windbglogtestone
\windbglogtestone>cdb -c ".logopen mylog.txt;q" cdb
Microsoft (R) Windows Debugger Version 10.0.16299.15 X86
0:000> cdb: Reading initial command '.logopen mylog.txt;q'
Opened log file 'mylog.txt'
quit:
\windbglogtestone>cd ..
>md windbglogtestwo
>cd windbglogtestwo
\windbglogtestwo>cdb -c ".logopen mylog.txt;q" cdb
Microsoft (R) Windows Debugger Version 10.0.16299.15 X86
0:000> cdb: Reading initial command '.logopen mylog.txt;q'
Opened log file 'mylog.txt'
quit:
\windbglogtestwo>cd ..
>dir /s /b *my*.txt
\windbglogtestone\mylog.txt
\windbglogtestwo\mylog.txt
it is created in the home directory where home represents the folder where windbg is installed (normally c:\progra~\w..kits..\debug.....\x..)
see below for a windbg installation in a different path
0:000> .logopen mylogfile.txt
Opened log file 'mylogfile.txt'
0:000> !homedir
Home directory is E:\windjs\windbg_16299\x86
0:000> .shell - dir *my*
Directory of E:\windjs\windbg_16299\x86
02/14/2018 09:07 AM 0 mylogfile.txt
1 File(s) 0 bytes
0 Dir(s) 102,247,899,136 bytes free
.shell: Process exited
Press ENTER to continue
in response to lieven's comment why the hyphen in .shell command
it represents a null input file
one can pass input files to .shell for processing instead of windbg commands
using -i instead of -c
pass a single hyphen to tell there is no input file
only the shell command indicated needs to be done
I have some files which I would like to be able to archive daily into a zip file that has the date in the filename.
The files to be archived are in one folder, let's call them a, b and c.
I would like them to be zipped into a file with the name archiveYYYYMMDD.zip into a second (different) folder where YYYYMMDD is the current date. I'm struggling to come up with a suitable batch file.
I'm running Windows 7 x64 Ultimate. I have a scheduling program which would run the batch file at a preset time every day.
Thanks
Alan
This can be done with shareware archiver WinRAR with a single command line:
"%ProgramFiles%\WinRAR\WinRAR.exe" a -afzip -agYYYYMMDD -cfg- -ed -ep1 -ibck -inul -m5 -r -y -- "Path to Backup Folder\Backup_.zip" "Path to Folder to Backup\"
This single command line can be executed directly as scheduled task. There is no need for a batch file.
The help of WinRAR opened by starting WinRAR and clicking in menu Help on menu item Help topics explains under Contents menu item Command line mode the command line syntax, the command a and the used switches.
I have downloaded some files with PSFTP from a SQL Server. The problem is that PSFTP changes the dates of creation/update and last modified of the files when downloading them in a local folder. For me it is important to keep the original dates. Is there any command to set/change it? Thanks
This is the script of the batch file
psftp.exe user#host -i xxx.ppk -b abc.scr
This is the scriptof the SCR file
cd /path remote folder
lcd path local folder
mget *.csv
exit
I'm not familiar with PSFTP and after looking at the docs I don't see any option to do this. However, you can use the -p flag of pscp to preserve dates and times.
See docs here.
(note it's a lower-case p, the other case is for specifying the port)
Currently there are 4.5 million files in a single directory on an NFS file system. As a result any read or write operation on that directory is causing a huge delay.
In order to over come this problem, all the files in that directory will be moved onto different directories based on the year of its creation.
Apparently, the find command that we are using with the -ctime option is not working because of the huge file volume.
We tried listing the files based on the year of creation and then feed the list to a script that will move them in a for loop. But even this failed as ls -lrt went for a hang.
Is there any other way to tackle this problem?
Please help.
Script contents:
1) filelist.sh
ls -tlr|awk '{print $8,$9,$6,$7}'|grep ^2011|awk '{print $2,$1,$3,$4}' 1>>inboundstore_$1.txt 2>>Error_$1.log
ls -tlr|awk '{print $8,$9,$6,$7}'|grep ^2011|wc -l 1>>count_$1.log
2) filemove.sh
INPUT_FILE=$1 ##text file which has the list of files from the previous script
FINAL_LOCATION=$2 ##destination directory
if [ -r $INPUT_FILE ]
then
for file in `cat $INPUT_FILE`
do
echo "TIME OF FILE COPY OF [$file] IS : `date`" >> xyz/IBSCopyTime.log
mv $file $FINAL_LOCATION
done
else
echo "$INPUT_FILE does not exist"
fi
Use the readdir iterator.
I'm trying to delete some files with unicode characters in them with batch script (it's a requirement). So I run cmd and execute:
> chcp 65001
Effectively setting codepage to UTF-8. And it works:
D:\temp\1>dir
Volume in drive D has no label.
Volume Serial Number is 8C33-61BF
Directory of D:\temp\1
02.02.2010 09:31 <DIR> .
02.02.2010 09:31 <DIR> ..
02.02.2010 09:32 508 1.txt
02.02.2010 09:28 12 delete.bat
02.02.2010 09:20 95 delete.cmd
02.02.2010 09:13 <DIR> Rún
02.02.2010 09:13 <DIR> Гуцул Каліпсо
3 File(s) 615 bytes
4 Dir(s) 11 576 438 784 bytes free
D:\temp\1>rmdir Rún
D:\temp\1>dir
Volume in drive D has no label.
Volume Serial Number is 8C33-61BF
Directory of D:\temp\1
02.02.2010 09:56 <DIR> .
02.02.2010 09:56 <DIR> ..
02.02.2010 09:32 508 1.txt
02.02.2010 09:28 12 delete.bat
02.02.2010 09:20 95 delete.cmd
02.02.2010 09:13 <DIR> Гуцул Каліпсо
3 File(s) 615 bytes
3 Dir(s) 11 576 438 784 bytes free
Then I put the same rmdir commands in batch script and save it in UTF-8 encoding. But when I run nothing happens, literally nothing: not even echo works from batch script in this case. Even saving script in OEM encoding does not help.
So it seems that when I change codepage to UTF-8 in console, scripts just stop working. Does somebody know how to fix that?
If you want to have unicode supported in batch file, then CHCP on a line by itself just aborts the batch file. What I suggest is putting CHCP on each batch file line that needs unicode as follows
chcp 65001 > nul && <real command here>
Example: In my case I wanted to have a nice TAIL of my log files while debugging, but the content for even Latin-1 characters was being messed up. So here is my batch file which wraps the real tail implementation from Windows Resource Kit.
#C:\WINDOWS\system32\chcp.com 65001 >nul && tail.exe -f %1
In addition, for output to a console, you need to set a true type font, i.e. Lucidia Console.
And apparently for output to a file the command line needs to run as Unicode, so you would kick off your batch script as follows
cmd /u /c <batch file command here>
Disclaimer: Tested on Windows XP sp3 with Windows Resource Kit.
The Unicode support in console, and especially in batch files, is pretty bad.
Can you "twist" the requirement to say PowerShell or Active Scripting (VBScript or JScript)?
It will save you a lot of grief in the long run (if you need to grow this beyond this simple task)
Not to mention that both PowerShell and ActiveScripting use way more powerful languages, allowing for functions, proper loops, real variables, debuggers, a lot of goodies for a more serious project.
Try inserting a blank line as first line in your batch file...
Line 1:
Line 2:CHCP 65001
Line 3:script commmands
Should work!