Windows 10 Make snipping tool capture after launching

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
If there are any probs, let me know and I'll create the files and zip them up for you :).
 

nivrip

Yorkshire Cruncher
Joined
Mar 21, 2007
Messages
10,881
Reaction score
2,137
Thanks again, Ian. The file name ends in .lnk so I'm a bit stuck. :)
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Here's a zip of the files you need - just pop both in the root of your My Documents folder. I modified the script slightly so there's no need to enter your username in the path.

Use the snipping_tool_launch shortcut to start it :).
 

Attachments

  • Snipping Tool Script.zip
    1.2 KB · Views: 148

nivrip

Yorkshire Cruncher
Joined
Mar 21, 2007
Messages
10,881
Reaction score
2,137
And another set of thanks, Ian. I've unzipped the files, put them in My Docs and created a launch shortcut but still no joy. :blush:
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
What happens when you just double click on "snipping_tool_launch", does it still just show a brief black screen?
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
If you can run "cmd" (or go to the command line another way) and then run the following code there, do you get any errors? That may find out what is happening :).

Code:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\%username%\Documents\snipping_tool_workaround.ps1"
 

nivrip

Yorkshire Cruncher
Joined
Mar 21, 2007
Messages
10,881
Reaction score
2,137
It states that the file does not exist.

CMD.JPG



??????
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
If you browse to c:\Users\Peter\Documents, can you see that the snipping_tool_workaround.ps1 file is there (rather than in a subfolder)? I know it sounds silly, but it's the only thing I can think of if it can't find the file as expected.
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Can you try right clicking the snipping_tool_workaround and select "run with powershell" and see if that works? I'm out of ideas regarding the error unfortunately, as it looks like it should work just fine (as the file is clearly there!).
 

nivrip

Yorkshire Cruncher
Joined
Mar 21, 2007
Messages
10,881
Reaction score
2,137
Yes it works that way. :)

But not by simply clicking on the icon. I have to right click and then select "Run with powershell" which is no quicker than selecting "New" in the old system. :)
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
I'm out of ideas on why it can't find the location unfortunately, and I expect troubleshooting it would take you longer than that extra click :lol:.
 
Joined
Aug 2, 2016
Messages
20
Reaction score
6
Sorry to hijack your thread here, but have you tried right clicking and using the 'run as powershell' command before you run the powershell script? The thing with powershell scripts is they don't always guarentee a fix to a problem, and powershell has so many features that it's a hindrance. I think what is happeneing is that in attempting the task, it jumps in and out of powershell accoridng to the task you want to accomplish.Some people prefer not to run powershell straight from the powershell command for this reason, so that you get automation and productivity by running scripts that automate repetitive tasks. Also the default execution policy can prevent scripts from running, or running properly. So don't forget to assign the 'Set-ExecutionPolicy RemoteSigned or Set-ExecutionPolicy Unrestricted' before you run the script. Also you usually need to add snapins or modules in order to make it run wihout the need for most of the above which is usually an annoyance and which most powershell users avoid taking the time to do. Best bet is to ask or log an issue on the forums on powershell.org if your still having problems with the script. Someone there will certainly solve the issue for you. I personally find the errors with it when I trying running a script that fails or doesn't work how I want, to be intimidating, and usually oftentimes it is because it isn't the appropriate message. Powershell is a huge learning curve, that's for sure lol.
 
Joined
Aug 2, 2016
Messages
20
Reaction score
6
Oops sorry, just noticed Ian already suggested asking you to try right clicking and running it with powershell lol. Missed that!
 
Joined
Aug 2, 2016
Messages
20
Reaction score
6
Have you set the powershell script to run from the batch file with admin permssiions? Just an idea if you haven't, to try it as follows:

Call your PowerShell script from a batch file with Administrative permissions (i.e. Run As Admin)

If your PowerShell script needs to be run as an admin for whatever reason, the 4th line of the batch file will need to change a bit:

1 @ECHO OFF
2 SET ThisScriptsDirectory=%~dp0
3 SET PowerShellScriptPath=%ThisScriptsDirectory%MyPowerShellScript.ps1
4 PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%PowerShellScriptPath%""' -Verb RunAs}";

We can’t call the PowerShell script as admin from the command prompt, but we can from PowerShell; so we essentially start a new PowerShell session, and then have that session call the PowerShell script using the –Verb RunAs argument to specify that the script should be run as an administrator.

And voila, that’s it. Now all anybody has to do to run your PowerShell script is double-click the batch file. So will your users really love you for this; well, no. Instead they just won’t be cursing you for sending them a script that they can’t figure out how to run. It’s one of those things that nobody notices until it doesn’t work.

I typically use this trick for myself too when my script requires admin rights, as it just makes running the script faster and easier.
 
Joined
Oct 2, 2017
Messages
2
Reaction score
0
It states that the file does not exist.

View attachment 9972


??????

In your code try changing the path. It seems you have an extra folder called "Snipping Tool Script" where you saved the files but you're not adding it into your code "C:\Users\%username%\Documents\Snipping_tool_workaround.ps1"
My recommendation is to delete that folder and move both your files, snipping_tool_launch and snipping_tool_workaround to the Documents folder. Once done that, use the following code for the path:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Peter\Documents\Snipping_tool_workaround.ps1"
(changed %username% to Peter. Also keep in mind there is one space between -File and "C:\Users\..."
I hope that works (though it's been a year it seems lol)
 
Joined
Oct 2, 2017
Messages
2
Reaction score
0
I want to ask, is there a way to hide the CMD window when launching the program? It appears very briefly but if anyone can remember a way to let it work "hidden" or in the background without appearing on the screen that would be awesome.
Thank you
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Snipping tool gone!!! 10
Missing Snipping Tool 6
very odd thing... 8
Snipping Tool 5
Keyboard shortcut for launching snipping tool 2
Windows 10 Windows 10 Is Hiding a Great Video Capture Tool 0
Vista Snipping Tool 4
Snipping Tool not working 1

Top