Is is possible to use a UVK script to open a command prompt and paste a line of text into it, and then have the script press enter (run)?
Like so...
<UVKCommandsScript>
<RunSfcScan>
<CmdScript>
@echo off
findstr /c:”[SR]” %windir%\Logs\CBS\CBS.log >”%userprofile%\Desktop\sfcdetails.txt”
The above snippet should, of course, run SFC and then the line of text should paste the SFC results onto the desktop for easy finding/reading.
Any assistance would be greatly appreciated!
[Solved]Paste line of text into a command prompt and run it?
Forum rules
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
Re: Paste a line of text into a command prompt and run it?
Hi netmonk99.
Your code should work fine. However, when I tested it, it didn't work because the double quotes had been modified, probably by copy/paste in the forum.
For instance, the code should be:
But not:
Do you see the difference in the double quotes?
Just rewrite them in the script and it should be fine.
To debug the result of the cmd commands you can use <RunWait> and cmd /k. e.g.
Hope it helps.
Your code should work fine. However, when I tested it, it didn't work because the double quotes had been modified, probably by copy/paste in the forum.
For instance, the code should be:
Code: Select all
<RunSfcScan>
<CmdScript>
@echo off
findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"
Code: Select all
<RunSfcScan>
<CmdScript>
@echo off
findstr /c:”[SR]” %windir%\Logs\CBS\CBS.log >”%userprofile%\Desktop\sfcdetails.txt”
Just rewrite them in the script and it should be fine.
To debug the result of the cmd commands you can use <RunWait> and cmd /k. e.g.
Code: Select all
<RunWait>
cmd /k findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.
Fred
Fred
Re: Paste a line of text into a command prompt and run it?
Ohh, okay, I see the difference now. Thanks for pointing that out!
And thanks for making such an awesome program!
And thanks for making such an awesome program!