Hello probably stupid question

Feb 20, 2015 at 9:48 PM
Edited Feb 20, 2015 at 9:49 PM

I can go into further setup details later but when I run this script and try to backup I get this for an error I searched google for cmd in powershell I dont find anything so I figure its my inputs that are wrong

7zBackup.ps1 ver. 1.9.10-Stable (http://7zbackup.codeplex.com)

Started : 02/20/2015 16:43:04
Backup Type : full
Archive Name : WARSAW-full-20150220-1643.7z
Archive Type : 7z
Destination : C:\7zBackup v. 1.9.10 Stable
Selection : C:\scripts\selection.txt
Recursion Depth : 100
Archive Attrs : Will be cleared
Rotate : Keep all archives
7Zip Switches : -bd -ssw -mx1 -md=96m -mmt=6 -mtc=on -mf=off -slp -scsUTF-8 -sccUTF-8

Backup from sources

  • scripts <== C:\scripts
    cmd : The term 'cmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
    verify that the path is correct and try again.
    At C:\scripts\7zBackup.ps1:1092 char:3
  • cmd /c MKLINK /D $jPath $jTarget | Out-Null
  • ~~~
    • CategoryInfo : ObjectNotFound: (cmd:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
Failed to create Symbolic Link [scripts] to [C:\scripts]
There are no selectable sources to backup. Quitting
True
Coordinator
Feb 21, 2015 at 3:43 PM
Could you please tell me which version of Windows are you on ?
Thank you.
Feb 23, 2015 at 1:47 PM
Edited Feb 23, 2015 at 2:52 PM
yep windows 7 64 bit.
And Powershell 4.0
I run the command in the powershell ISE
Feb 23, 2015 at 2:54 PM
I seemed to miss some of the errrors in output heres the whole thing

PS C:\scripts> .\7zBackup.ps1 --type full --selection .\selection.txt
Exception setting "TreatControlCAsInput": "The handle is invalid.
"
At C:\scripts\7zBackup.ps1:1692 char:1
  • [console]::TreatControlCAsInput = $True
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [], SetValueInvocationException
    • FullyQualifiedErrorId : ExceptionWhenSetting

7zBackup.ps1 ver. 1.9.10-Stable (http://7zbackup.codeplex.com)

Started : 02/23/2015 09:53:40
Backup Type : full
Archive Name : WARSAW-full-20150223-0953.7z
Archive Type : 7z
Destination : C:\7zBackup v. 1.9.10 Stable
Selection : C:\scripts\selection.txt
Recursion Depth : 100
Archive Attrs : Will be cleared
Rotate : Keep all archives
7Zip Switches : -bd -ssw -mx1 -md=96m -mmt=6 -mtc=on -mf=off -slp -scsUTF-8 -sccUTF-8

Backup from sources

  • scripts <== C:\scripts
    cmd : The term 'cmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
    verify that the path is correct and try again.
    At C:\scripts\7zBackup.ps1:1092 char:3
  • cmd /c MKLINK /D $jPath $jTarget | Out-Null
  • ~~~
    • CategoryInfo : ObjectNotFound: (cmd:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
Failed to create Symbolic Link [scripts] to [C:\scripts]
There are no selectable sources to backup. Quitting
True
Coordinator
Feb 24, 2015 at 5:30 PM
Edited Feb 24, 2015 at 5:31 PM
That's unusual.

CMD is absolutely recognized by powershell as valid.

Can you do this test for me ?
Open a powershell prompt and simply type "CMD" followed by Enter.
What happens ?

Again ... what happens if you do START->Run and enter CMD ?

In addition: are you sure you are running the script with administrative privileges ? Are there any computer policies which prevent usage of command prompt in your environment ?

Best regards.
Feb 24, 2015 at 5:48 PM
Edited Feb 24, 2015 at 6:06 PM
PS C:\scripts> CMD
Cannot start "CMD". Interactive console applications are not supported.
To run the application, use the Start-Process cmdlet or use "Start PowerShell.exe" from the File menu.
To view/modify the list of blocked console applications, use $psUnsupportedConsoleApplications, or consult online help.
At line:0 char:0

Ah let me try my doing this in the powershell.exe cause I guess for whatever reason powershell ISE is not allowing this and yes I am running as admin. elavated on he prompt

And Start-run-CMD brings up command prompt like it should
Feb 24, 2015 at 5:57 PM
And in powershell I get
PS C:\scripts> CMD
CMD : The term 'CMD' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
  • CMD
  • ~~~
    • CategoryInfo : ObjectNotFound: (CMD:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
Feb 24, 2015 at 6:13 PM
Ok nevermind whatever reason my comp is screwing up I don't care. Works on a different computer just fine so I'm ok with that. Awesome program by the way. And thank you for pointing me to my computer being the problem.