4 ms·
Since I so rarely see a Windows thread, perhaps folks wont mind me asking: What utilities or code would you leverage if you had a use case to run a program on a
by coderintherye 4y ago
Since I so rarely see a Windows thread, perhaps folks wont mind me asking:
What utilities or code would you leverage if you had a use case to run a program on a Windows machine once a day and look for any CSV/XLS/XLSX files and then copy those to another server? (With full knowledge of the owner of said computer, they are just lacking in proficiency to do anything even as simple as connect Box Sync)
- greatpnwfood1 4y agoclassic batchfiles scheduled via Windows Task Scheduler, use WinSCP (free)
- eightysixfour 4y agoPowershell and Task Scheduler. Are you looking in particular directories or across the whole system?
- coderintherye 4y agoAnything in C:/ essentially, because there is no standard place to where different users keep their associated files.
- mandeepj 4y agoSyncToy - https://filehippo.com/download_synctoy_64/ https://filehippo.com/download_synctoy_64/ It’s not actively maintained though
- coderintherye 4y agoThanks! Any idea if it can be customized ahead of install? Trying to walk these users through setting it up themselves would be unlikely to succeed. They can install a program, but likely not succeed in customizing what the program does.
- 616c 4y agoTo piggyback on the Powershell and scheduled tasks cement: robocopy and scheduled tasks so how I did this years ago for years. Built into windows since Windows 7 iirc.
- coderintherye 4y agoI've used robocopy + task scheduler before actually for this use case but as far as I could tell robocopy doesn't have a way to search across directories to find files but rather just gets set up on a particular directory. Maybe something in Powershell to find the files and then copy them into a folder which is then set up with Robocopy? Note, I have no access to the computer itself and the users are incapable of doing much beyond downloading a .exe file and installing a program, so whatever is done has to be as close to simple as that for them.
- cshokie 4y agoThe Windows Task Scheduler is probably the way to go. You can create tasks that run on a variety of schedules or events. They can run a script that does what you need. There is a PowerShell module for managing scheduled tasks. It should be possible to write a script that will create the appropriate scheduled tasks on behalf of the non-proficient user. They just need to run the PowerShell script once to get things going.
- coderintherye 4y agoThanks, but is there a way to do that without having access to the computer or having to try to walk the user through setting up a task in task scheduler? The users in this use case can do something as simple as download and install a .exe program, but there is no way they would manage setting something up in Task Scheduler. I've used Task Scheduler via remote desktop (which itself was a pain to get them able to set up) to set things up for them before but that is not scalable.
- cshokie 4y agoYes that is what the PowerShell module is for. You can script things like ‘New-ScheduledTask’ and give it the appropriate parameters. The only thing the user would need to do is run the script. That could create the scheduled tasks and drop the “real” scripts where the scheduled tasks can find them. It can be helpful to send along a tuple of {PowerShell, cmd} where cmd just forwards arguments to PowerShell. That way you can run “PowerShell -ExecutionPolicy Bypass myscript.ps1 %*” and avoid the pain of changing the system-wide security policy for PowerShell scripts. (Unsigned PowerShell scripts are blocked by default).
- majkinetor 4y agoThere are number of alternatives. 1. Just powershell in a loop working as a service 2. Task Scheduler 3. Rundeck 4. Pode WinScp is awesome for linux, and you can use simple PowerShell remoting for windows.
- genewitch 4y agoi'm having trouble coming up with ethical reasons to want .csv and .xlsx files from users that aren't "proficient at configuring software". A good backup solution will use deltas and do exactly this, and be preconfigured or configured-at-runtime. If you really must, you can always write the program yourself, it sounds very easy. Deploy it with an installer that copies a link into Startup, the whole bit.