![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | open a file, wait for user to amend file, close & process Hi all, I'm creating a 'run ad hoc' sql file. It runs file.sql against a list of servers. I want the user to be able to amend the contents of file.sql before running it. I need to get my script to open the file: ( notepad file.sql ) let the user amend & save the contents. then carry on & run the file. ( osql . . . -i file.sql ) I can get it to open file.sql but the rest of the script just plays on in the background. It doesn't wait until the file is changed and closed. If you help, I will be eternally grateful! |
My System Specs![]() |
| | #2 (permalink) |
| | Re: open a file, wait for user to amend file, close & process Pipe the notepad statement to Out-Null, this will cause the script to wait until notepad is closed by the user. # create a test file Set-Content qt.txt 'line 1' # copy this script and run it # -< script.ps1 >- 'start!' notepad .\qt.txt | Out-Null cmd /c type qt.txt 'done!' -- Robert |
My System Specs![]() |
| | #3 (permalink) |
| | Re: open a file, wait for user to amend file, close & process Rob, you rock! This works like a dream. Thank you for taking the time to answer. ![]() "Robert Robelo" wrote: Quote: > Pipe the notepad statement to Out-Null, this will cause the script to wait until notepad is closed by the user. > > # create a test file > Set-Content qt.txt 'line 1' > > # copy this script and run it > # -< script.ps1 >- > 'start!' > notepad .\qt.txt | Out-Null > cmd /c type qt.txt > 'done!' > > -- > Robert |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
File menu open/close issue | General Discussion | |||
| Failover Guest Cluster -- 'The process cannot access the file becauseit is being used by another process.' | Virtual Server | |||
| in vb.net how to open a file from file download prompt without askinguser to save it or run it....just open it in internet explorer | .NET General | |||
| Encrypt File / Decrypt File / Open/Close PSD | Vista General | |||
| How to close open file handles? | PowerShell | |||