Would like to not create an empty csv file
Moderators: chulett, rschirm, roy
Hi,
My JOB :
In the first stage "Execute Command", the command is cd MYDIRECTORY , it's works
In the second stage, the command is for /F "delims=" %A in ('dir /b *.csv') do if %~zA LSS 250 del "%~dpnxA" but it doesn't work.
Errors :
- Command for /F "delims=" %A in ('dir /b *.csv') do if %~zA LSS 250 del "%~dpnxA" did not finish OK, reply = '1'
- delims was unexpected at this time.
What is strange, is that it works with "cmd.exe".
Please need backup.
My JOB :
In the first stage "Execute Command", the command is cd MYDIRECTORY , it's works
In the second stage, the command is for /F "delims=" %A in ('dir /b *.csv') do if %~zA LSS 250 del "%~dpnxA" but it doesn't work.
Errors :
- Command for /F "delims=" %A in ('dir /b *.csv') do if %~zA LSS 250 del "%~dpnxA" did not finish OK, reply = '1'
- delims was unexpected at this time.
What is strange, is that it works with "cmd.exe".
Please need backup.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
When I stated
I did not intend for you to put ; OR %% between the two commands. I meant you to put ; between the two commands, or to put && between the two commands. That's why the word "either" was there.
ray wurlod wrote:either a ";" or a "&&" between them
I did not intend for you to put ; OR %% between the two commands. I meant you to put ; between the two commands, or to put && between the two commands. That's why the word "either" was there.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
You mean the MKS Toolkit and AFAIK you wouldn't have it if you have a Server only license, which I believe is the case here. And for 9.1 I think that they will all still be there but will be implemented differently under the covers. At least that's the impression I got from what Ray has posted so far on the subject.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
&& is valid for DOS.chulett wrote:Never mind the fact that && is valid for UNIX, not DOS.
See, for example, Conditional Execution - Conditional Execution Based on Result of Previous Command in DOS Script Snippets.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.