Have .bat display info during execution (of WinSCP)










2















Before I start I want to say thank you in advance for any help provided. This is my first post and I have tried to follow the rules. I checked but couldn't find this answered anywhere.



I have a batch file that I have set to run at a scheduled time daily. The file uses WinSCP to grab the contents of a folder on a server and copies them to a local directory. The size of the transfer is about 1.2GB - 1.5GB and takes about 20 seconds. I would like to display some information while the transfer happens. I'm looking for a way to display the bytes per second going over my network interface (or similar) in the same cmd window as the transfer.



I figured out how to get the info I want to display by doing:



typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec"


I'm just wondering if there is a way to display the information that is returned from the typeperf command while my file transfer completes. Then, at the end of the transfer have the window close. Sort of like some text that says "Please Wait" while the program runs except it would show bytes/sec over the interface.



Here is my script i use for the WinSCP FTP transfer with the ip and username removed:



"C:Program Files (x86)WinSCPWinSCP.exe" /ini=nul /command "open ftp://UserNamer:StrongPassword1@###.###.###.###/" "cd /ShooterGame/Saved" "lcd ""D:ARK Server Backup""" "get SavedArk57057" "exit"


Looking forward to any help that can be provided, assuming what I was is actually possible.










share|improve this question



















  • 1





    The only way to get output I know off is the output of the WinSCP.exe itself. Batchfiles are purely sequential maters. As long as the last called programm has not ended, the batchfile will not continue. Short of having a console Programm taht fakes to be a batchfile I see no way. And that propably goes overboard.

    – Christopher
    Nov 14 '18 at 23:58











  • The most you could do here is have it update the output each time a file transfer completes. Something like copying file: file.txt..., copying file: file.py... etc.

    – emsimpson92
    Nov 15 '18 at 0:04











  • Try this: start "" /B "The WinSCP.exe command" and its parameters followed by typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec" -sc 20

    – Aacini
    Nov 15 '18 at 2:24















2















Before I start I want to say thank you in advance for any help provided. This is my first post and I have tried to follow the rules. I checked but couldn't find this answered anywhere.



I have a batch file that I have set to run at a scheduled time daily. The file uses WinSCP to grab the contents of a folder on a server and copies them to a local directory. The size of the transfer is about 1.2GB - 1.5GB and takes about 20 seconds. I would like to display some information while the transfer happens. I'm looking for a way to display the bytes per second going over my network interface (or similar) in the same cmd window as the transfer.



I figured out how to get the info I want to display by doing:



typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec"


I'm just wondering if there is a way to display the information that is returned from the typeperf command while my file transfer completes. Then, at the end of the transfer have the window close. Sort of like some text that says "Please Wait" while the program runs except it would show bytes/sec over the interface.



Here is my script i use for the WinSCP FTP transfer with the ip and username removed:



"C:Program Files (x86)WinSCPWinSCP.exe" /ini=nul /command "open ftp://UserNamer:StrongPassword1@###.###.###.###/" "cd /ShooterGame/Saved" "lcd ""D:ARK Server Backup""" "get SavedArk57057" "exit"


Looking forward to any help that can be provided, assuming what I was is actually possible.










share|improve this question



















  • 1





    The only way to get output I know off is the output of the WinSCP.exe itself. Batchfiles are purely sequential maters. As long as the last called programm has not ended, the batchfile will not continue. Short of having a console Programm taht fakes to be a batchfile I see no way. And that propably goes overboard.

    – Christopher
    Nov 14 '18 at 23:58











  • The most you could do here is have it update the output each time a file transfer completes. Something like copying file: file.txt..., copying file: file.py... etc.

    – emsimpson92
    Nov 15 '18 at 0:04











  • Try this: start "" /B "The WinSCP.exe command" and its parameters followed by typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec" -sc 20

    – Aacini
    Nov 15 '18 at 2:24













2












2








2


1






Before I start I want to say thank you in advance for any help provided. This is my first post and I have tried to follow the rules. I checked but couldn't find this answered anywhere.



I have a batch file that I have set to run at a scheduled time daily. The file uses WinSCP to grab the contents of a folder on a server and copies them to a local directory. The size of the transfer is about 1.2GB - 1.5GB and takes about 20 seconds. I would like to display some information while the transfer happens. I'm looking for a way to display the bytes per second going over my network interface (or similar) in the same cmd window as the transfer.



I figured out how to get the info I want to display by doing:



typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec"


I'm just wondering if there is a way to display the information that is returned from the typeperf command while my file transfer completes. Then, at the end of the transfer have the window close. Sort of like some text that says "Please Wait" while the program runs except it would show bytes/sec over the interface.



Here is my script i use for the WinSCP FTP transfer with the ip and username removed:



"C:Program Files (x86)WinSCPWinSCP.exe" /ini=nul /command "open ftp://UserNamer:StrongPassword1@###.###.###.###/" "cd /ShooterGame/Saved" "lcd ""D:ARK Server Backup""" "get SavedArk57057" "exit"


Looking forward to any help that can be provided, assuming what I was is actually possible.










share|improve this question
















Before I start I want to say thank you in advance for any help provided. This is my first post and I have tried to follow the rules. I checked but couldn't find this answered anywhere.



I have a batch file that I have set to run at a scheduled time daily. The file uses WinSCP to grab the contents of a folder on a server and copies them to a local directory. The size of the transfer is about 1.2GB - 1.5GB and takes about 20 seconds. I would like to display some information while the transfer happens. I'm looking for a way to display the bytes per second going over my network interface (or similar) in the same cmd window as the transfer.



I figured out how to get the info I want to display by doing:



typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec"


I'm just wondering if there is a way to display the information that is returned from the typeperf command while my file transfer completes. Then, at the end of the transfer have the window close. Sort of like some text that says "Please Wait" while the program runs except it would show bytes/sec over the interface.



Here is my script i use for the WinSCP FTP transfer with the ip and username removed:



"C:Program Files (x86)WinSCPWinSCP.exe" /ini=nul /command "open ftp://UserNamer:StrongPassword1@###.###.###.###/" "cd /ShooterGame/Saved" "lcd ""D:ARK Server Backup""" "get SavedArk57057" "exit"


Looking forward to any help that can be provided, assuming what I was is actually possible.







windows bash batch-file ftp winscp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 7:04









Martin Prikryl

89k22175379




89k22175379










asked Nov 14 '18 at 23:47









Thor Brenner GostassonThor Brenner Gostasson

132




132







  • 1





    The only way to get output I know off is the output of the WinSCP.exe itself. Batchfiles are purely sequential maters. As long as the last called programm has not ended, the batchfile will not continue. Short of having a console Programm taht fakes to be a batchfile I see no way. And that propably goes overboard.

    – Christopher
    Nov 14 '18 at 23:58











  • The most you could do here is have it update the output each time a file transfer completes. Something like copying file: file.txt..., copying file: file.py... etc.

    – emsimpson92
    Nov 15 '18 at 0:04











  • Try this: start "" /B "The WinSCP.exe command" and its parameters followed by typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec" -sc 20

    – Aacini
    Nov 15 '18 at 2:24












  • 1





    The only way to get output I know off is the output of the WinSCP.exe itself. Batchfiles are purely sequential maters. As long as the last called programm has not ended, the batchfile will not continue. Short of having a console Programm taht fakes to be a batchfile I see no way. And that propably goes overboard.

    – Christopher
    Nov 14 '18 at 23:58











  • The most you could do here is have it update the output each time a file transfer completes. Something like copying file: file.txt..., copying file: file.py... etc.

    – emsimpson92
    Nov 15 '18 at 0:04











  • Try this: start "" /B "The WinSCP.exe command" and its parameters followed by typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec" -sc 20

    – Aacini
    Nov 15 '18 at 2:24







1




1





The only way to get output I know off is the output of the WinSCP.exe itself. Batchfiles are purely sequential maters. As long as the last called programm has not ended, the batchfile will not continue. Short of having a console Programm taht fakes to be a batchfile I see no way. And that propably goes overboard.

– Christopher
Nov 14 '18 at 23:58





The only way to get output I know off is the output of the WinSCP.exe itself. Batchfiles are purely sequential maters. As long as the last called programm has not ended, the batchfile will not continue. Short of having a console Programm taht fakes to be a batchfile I see no way. And that propably goes overboard.

– Christopher
Nov 14 '18 at 23:58













The most you could do here is have it update the output each time a file transfer completes. Something like copying file: file.txt..., copying file: file.py... etc.

– emsimpson92
Nov 15 '18 at 0:04





The most you could do here is have it update the output each time a file transfer completes. Something like copying file: file.txt..., copying file: file.py... etc.

– emsimpson92
Nov 15 '18 at 0:04













Try this: start "" /B "The WinSCP.exe command" and its parameters followed by typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec" -sc 20

– Aacini
Nov 15 '18 at 2:24





Try this: start "" /B "The WinSCP.exe command" and its parameters followed by typeperf "Network Interface(Realtek PCIe GbE Family Controller)Bytes Received/sec" -sc 20

– Aacini
Nov 15 '18 at 2:24












1 Answer
1






active

oldest

votes


















2














WinSCP itself shows a transfer progress. Except that you run WinSCP in a hidden mode.



Replace winscp.exe with winscp.com to display a transfer progress in a console window.



enter image description here




If you want to display a progress in your own custom format, use WinSCP .NET assembly [for example from a PowerShell script] instead of WinSCP scripting. And handle Session.FileTransferProgress event.



There's a guide for converting WinSCP script to PowerShell script with use of WinSCP .NET assembly.






share|improve this answer

























  • Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

    – Thor Brenner Gostasson
    Nov 15 '18 at 23:39











  • If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

    – Martin Prikryl
    Nov 16 '18 at 6:54










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310465%2fhave-bat-display-info-during-execution-of-winscp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














WinSCP itself shows a transfer progress. Except that you run WinSCP in a hidden mode.



Replace winscp.exe with winscp.com to display a transfer progress in a console window.



enter image description here




If you want to display a progress in your own custom format, use WinSCP .NET assembly [for example from a PowerShell script] instead of WinSCP scripting. And handle Session.FileTransferProgress event.



There's a guide for converting WinSCP script to PowerShell script with use of WinSCP .NET assembly.






share|improve this answer

























  • Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

    – Thor Brenner Gostasson
    Nov 15 '18 at 23:39











  • If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

    – Martin Prikryl
    Nov 16 '18 at 6:54















2














WinSCP itself shows a transfer progress. Except that you run WinSCP in a hidden mode.



Replace winscp.exe with winscp.com to display a transfer progress in a console window.



enter image description here




If you want to display a progress in your own custom format, use WinSCP .NET assembly [for example from a PowerShell script] instead of WinSCP scripting. And handle Session.FileTransferProgress event.



There's a guide for converting WinSCP script to PowerShell script with use of WinSCP .NET assembly.






share|improve this answer

























  • Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

    – Thor Brenner Gostasson
    Nov 15 '18 at 23:39











  • If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

    – Martin Prikryl
    Nov 16 '18 at 6:54













2












2








2







WinSCP itself shows a transfer progress. Except that you run WinSCP in a hidden mode.



Replace winscp.exe with winscp.com to display a transfer progress in a console window.



enter image description here




If you want to display a progress in your own custom format, use WinSCP .NET assembly [for example from a PowerShell script] instead of WinSCP scripting. And handle Session.FileTransferProgress event.



There's a guide for converting WinSCP script to PowerShell script with use of WinSCP .NET assembly.






share|improve this answer















WinSCP itself shows a transfer progress. Except that you run WinSCP in a hidden mode.



Replace winscp.exe with winscp.com to display a transfer progress in a console window.



enter image description here




If you want to display a progress in your own custom format, use WinSCP .NET assembly [for example from a PowerShell script] instead of WinSCP scripting. And handle Session.FileTransferProgress event.



There's a guide for converting WinSCP script to PowerShell script with use of WinSCP .NET assembly.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 16 '18 at 7:26

























answered Nov 15 '18 at 6:47









Martin PrikrylMartin Prikryl

89k22175379




89k22175379












  • Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

    – Thor Brenner Gostasson
    Nov 15 '18 at 23:39











  • If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

    – Martin Prikryl
    Nov 16 '18 at 6:54

















  • Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

    – Thor Brenner Gostasson
    Nov 15 '18 at 23:39











  • If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

    – Martin Prikryl
    Nov 16 '18 at 6:54
















Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

– Thor Brenner Gostasson
Nov 15 '18 at 23:39





Thank you! Not exactly what I wanted but I understand that what I wanted is impossible. This will work fine!

– Thor Brenner Gostasson
Nov 15 '18 at 23:39













If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

– Martin Prikryl
Nov 16 '18 at 6:54





If you want to display a progress in your own custom format, use WinSCP .NET assembly [from a PowerShell script] instead of WinSCP scripting - See my edited answer.

– Martin Prikryl
Nov 16 '18 at 6:54



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310465%2fhave-bat-display-info-during-execution-of-winscp%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto