Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How command prompt communicate with hardware
if i give mkdir command it will create the directory
how this command works internally
can i create own commands.
You need to notice the difference between the OS and the shell. Shell is only a user-land program. When you type a command, the command is the name of another program(or some built-in command in shell itself), shell find the corresponding program and execute it.
The operations at this level is much higher than hardware, it's just user-land program call.
For mkdir, you type which mkdir then will find the path of this program named mkdir. If you want to create your own, just compile your own program and run it from shell.
First of all MKDIR doesn't change the Directory it Makes the new directory.
& These program internally runs like a Bash Script/Batch File, which are few predefined codes in the OS.
You can create your own command by creating Batch File, For which you need Notepad, Little Programing Skill & Output Parameters you Want To Achieve.
This Link Might help Creating CMD File
Related
This question already has answers here:
How can I start an interactive console for Perl?
(24 answers)
Closed 1 year ago.
I have asked a similar question elsewhere but it eventually evolved into a series of comments. So once again, what package should I install to see the following prompt > after running perl but now not raku (all under Cygwin)?
EDIT
-l doesn't work either.
EDIT 2
Perl -d -e1 doesn't work for me either (Answer in comments as this question is closed):
You didn't provide the name of a program, and you didn't provide a program via the -e or -E command line options, so it's reading the program from STDIN.
perl does have a builtin debugger that you access by passing -d, but you still need to provide a program. (You can provide a trivial one using -e1.)
See How can I start an interactive console for Perl? for alternatives.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I keep getting the same error with my chocolatey package: Exit code was '-1'. I am not sure if it is something wrong with my chocolateyinstall.ps1 or the setup.exe I am using to make this embedded installer. The image below shows both the chocolateyinstall.ps1 and the cmd when trying to run choco install (packagename). Thanks.
Here is the code:
$packageArgs = #{
packageName = 'armrvds'
fileType = 'exe'
file = "$(Split-Path -parent $MyInvocation.Mycommand.Definition)\setup.exe"
validExitCodes = #(0)
softwareName = 'ARM RVDS 4.1*'
Install-ChocolateyInstallPackage #packageArgs
https://ibb.co/Mpnh0mq
Exit code was '-1' means that the exit code of the installer was -1, and not 0 or another acceptable exit code to be treated as successful. You will need to figure out why your setup.exe is failing. You may be able to find more information about why the installer failed if you look at C:\ProgramData\Chocolatey\logs\chocolatey.log as the error indicates.
One thing I notice is you are not setting the silent installation arguments as part of your arguments to Install-ChocolateyInstallPackage, which at a minimum may cause your package to require interactivity (you don't want this). You should find out what the silent installation arguments are to setup.exe.
In your case, it looks like RVDS uses a different program to install silently (page 7). Note that this is for 3.1, not 4.1, so you should either try to find up to date documentation, or see if setupcli still exists in 4.1 and start looking at the parameters it supports.
This question already has answers here:
Is there a way to programmatically set the ApartmentState to STA?
(2 answers)
Closed 7 years ago.
I have a script that needs to run in single-threaded mode, and I currently start it up with the -sta parameter with a batch. Is it possible to run the script in -sta mode only executing the Script? I thought about moving the whole script into one function and execute this function in single-threaded mode.
Is that possible? I don't want to give out a batch file and my ps1.
I think if you were to get PowerGUI and put the script into this, you would be able to package the PS1 file into an exe file which can just be executed like a normal program.
Once PowerGUI is installed you can do this from Tools, Complile Script.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have written a perl script which running fine in my system but not working in some other system.
It is showing error "can't execute ...... at line 1".
everything is set up. I have tested in version 5.8.2 and working fine. But in 5.8.6 it is not working. While compile this code I got that Archive/Tar.pm is missing.
I have checked in my system perl lib folder there is no such Folder/module. Also I didnt get any result for perldoc -lm Archive::Tar in my system but still it is running fine.
Can you let me know what might be the possible problem ?
First line :: #! C:\system\Perl
This program is for windows
Try running dos2unix on your script. It probably has Carriage Returns in the first line.
dos2unix yourscript
You can check with
cat -vet yourscript
CR shows up as ^M.
Also, try running:
which perl
and make sure that your first line matches the answer.
Try running the script using:
perl yourscript
rather than
./yourscript
Are you sure the first line is terminated correctly for your OS (for example, Linux hates CR+LF line terminators... :-)
If Perl is saying that Archive::Tar is missing then it is probably right. Don't argue with it - just install the module.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a batch file called test.bat. I am calling the below instructions in the test.bat file:
start /min powershell.exe %sysdrive%\testScripts\testscript1.ps1
When I run this through the command prompt, my testscript is running successfully. I want to run it as administrator (as if I have created a desktop shortcut and run as administrator. It shouldn't prompt for any username or password).
I have tried adding /elevate and /NOUAC parameters in the above test.bat, but no luck. How do I fix this issue?
I know how to do it manually, but I want this to be executed from the command prompt.
(By Marnix Klooster): ...without using any additional tools, like those suggested in an answer to Super User question How to run program from command line with elevated rights.)
Try this:
runas.exe /savecred /user:administrator "%sysdrive%\testScripts\testscript1.ps1"
It saves the password the first time and never asks again. Maybe when you change the administrator password you will be prompted again.
See this TechNet article: Runas command documentation
From a command prompt:
C:\> runas /user:<localmachinename>\administrator cmd
Or, if you're connected to a domain:
C:\> runas /user:<DomainName>\<AdministratorAccountName> cmd
It looks like psexec -h is the way to do this:
-h If the target system is Windows Vista or higher, has the process
run with the account's elevated token, if available.
Which... doesn't seem to be listed in the online documentation in Sysinternals - PsExec.
But it works on my machine.