New
#1
Wanted: Sample scripts to cannibalize
I need to create a simple (I hope) script and have it working in less than 2 weeks. I'm not terribly proficient in any scripting language but am comfortable with .bat scripts and can stumble around in .vbs (given good samples). PowersShell might as well be Sanskrit. (I know I should learn PS but the learning curve is too long for this project.) JavaScript is another possibility. I've never used it, but I suspect it has a shorter learning curve than PS.
The script needs to
- Present and process a file selection display of some sort. It would be ideal if it looked and felt similar to File Explorer but I'll accept anything that works.
- Open a file, read the data, and close the file.
- Modify the data read in step 2. The data will be a number of file paths - local, not UNCs.
- Open a file, write data (overwriting, if it already exists), and close the file.
(I assume steps 2, 3, and 4 will happen concurrently.)- Invoke a program (as though using "Open With" in File Explorer) to process the data written in step 4.
I'm sort of envisioning this as an HTA, but I could use anything that works.
I'm not worried about steps 2, 3, and 4; I'm sure I can get that part to work. I have no idea how to do step 1 although I'm sure it can be done. A lot of applications do that.
I am most worried about step 5. I have no idea how "Open With" passes the selected file's path to the program or the program accesses that data. (Is it just like calling a program with an argument?)
I will be writing this on Win10 21H1 (build 19043.1348) but it will have to run on some very old computers running Win7, on newer computers running Win10, and probably eventually on Win11.
Are there some scripts around that I can use as models?