Hello together,
i want to save files which are dragged into a richtextbox to a dynamic path (depending on date in pathname).
How can i now save the dragged files to Disk by clicking on a button?
The script should be for documentations for example i should create a new user and for documentation reasons i want to drag and drop the mail with the instruction and a small documentation by me to a seperate folder.
I hope you unterstand and can help me.
Thank you in advice!
Save files which are drag and dropped to sepcific path
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- michael.heinrich
- Posts: 8
- Last visit: Tue Mar 12, 2024 6:05 am
Save files which are drag and dropped to sepcific path
- Attachments
-
- dragdropactivate.png (1.39 KiB) Viewed 2181 times
-
- Drag.png (5.87 KiB) Viewed 2181 times
- michael.heinrich
- Posts: 8
- Last visit: Tue Mar 12, 2024 6:05 am
Re: Save files which are drag and dropped to sepcific path
Hi. thanks for the fast reply.
i tried: Write-Host $richtextbox1.Lines.GetValue but thats thte output:
System.Object GetValue(Params int[] indices), System.Object GetValue(int index), System.Object GetValue(int index1, int index2), System.Object GetValue(int index1, int index2, int index3), System.Object GetValue(long index), System.Object GetValue(long index1, long index2), System.Object GetValue(long index1, long index2, long index3), System.Object GetValue(Params long[] indices)
It would be okay if i get the filepath to start a robocopy of the file but would be better if i can drag it into the richttextbox and directly save it out of the richtextbox by click on button.
Do you have any idea?
Sorry that topic is new to mew.
thank you.
i tried: Write-Host $richtextbox1.Lines.GetValue but thats thte output:
System.Object GetValue(Params int[] indices), System.Object GetValue(int index), System.Object GetValue(int index1, int index2), System.Object GetValue(int index1, int index2, int index3), System.Object GetValue(long index), System.Object GetValue(long index1, long index2), System.Object GetValue(long index1, long index2, long index3), System.Object GetValue(Params long[] indices)
It would be okay if i get the filepath to start a robocopy of the file but would be better if i can drag it into the richttextbox and directly save it out of the richtextbox by click on button.
Do you have any idea?
Sorry that topic is new to mew.
thank you.
- michael.heinrich
- Posts: 8
- Last visit: Tue Mar 12, 2024 6:05 am
Re: Save files which are drag and dropped to sepcific path
Sorry what do you mean by enumerate lines?
Re: Save files which are drag and dropped to sepcific path
In PowerShell we enumerate collections in many ways. Enumeration is a fundamental of all programming and scriptin.
See: https://en.wikipedia.org/wiki/Enumeration
PowerShell uses foreach, ForEach-Object, for and other methods to enumerate collections.
$richtextbox1.Lines.ForEach({Write "This is a line $_"})
See: https://en.wikipedia.org/wiki/Enumeration
PowerShell uses foreach, ForEach-Object, for and other methods to enumerate collections.
$richtextbox1.Lines.ForEach({Write "This is a line $_"})