Hi
Hopefully you can see what i am trying to achieve here.
$item is a file name such as "test.txt" or "test file.txt"
i am attempting to delete this file using CMD as follows:
This Works (in CMD):
This Does Not Work (in CMD):
...Because you have to enclose the file name in "" if it contains spaces, thus:
This Works (in CMD):
Now to ScriptFTP...
I have tried all ways including using ' instead of/combined with " as mentioned at:
http://www.scriptftp.com/reference.php?go=topic260
and various posts in the forum.
The ScriptFTP code is as follows and:
Works:
IF $item = "test.txt"
Does Not Work:
IF $item = "test file.txt"
Any suggestions greatly appreciated.
Hopefully you can see what i am trying to achieve here.
$item is a file name such as "test.txt" or "test file.txt"
i am attempting to delete this file using CMD as follows:
This Works (in CMD):
del test.txt
This Does Not Work (in CMD):
del test file.txt
...Because you have to enclose the file name in "" if it contains spaces, thus:
This Works (in CMD):
del "test file.txt"
Now to ScriptFTP...
I have tried all ways including using ' instead of/combined with " as mentioned at:
http://www.scriptftp.com/reference.php?go=topic260
and various posts in the forum.
The ScriptFTP code is as follows and:
Works:
IF $item = "test.txt"
Does Not Work:
IF $item = "test file.txt"
FTP Script
- $CommandLine="del ".$item
Any suggestions greatly appreciated.
Thanks Wandrey
liked Script FTP? Try our other product Email Parser
Its been a while....
I can not get the following to work.
[ScriptFTP]$CommandLine='del /f /q D:\Slides\"'.$item'"'
EXEC($CommandLine)[/ScriptFTP]
The $item is coming from a dynamically generated list of remote files
I can not get the following to work.
[ScriptFTP]$CommandLine='del /f /q D:\Slides\"'.$item'"'
EXEC($CommandLine)[/ScriptFTP]
The $item is coming from a dynamically generated list of remote files
SOLVED
The correct code should be:
[ScriptFTP]$CommandLine='del /f /q "D:\Slides\'.$item.'"'
EXEC($CommandLine)[/ScriptFTP]
There was a . missing after $item
The correct code should be:
[ScriptFTP]$CommandLine='del /f /q "D:\Slides\'.$item.'"'
EXEC($CommandLine)[/ScriptFTP]
There was a . missing after $item
- All times are UTC -