command-prompt

How can i Compile a C program on Dos prompt using tcc and tc

核能气质少年 提交于 2019-12-24 02:42:28
问题 I want to compile c program on dos prompt using tcc as well as tc without using c editor. please give the full procedure. 回答1: I would look at the TCC documentation, specifically the quick start guide, provided on the TCC web page. Assuming you have some source code already, a compilation is as simple as tcc -o executable.exe sourcefile.c You can also run a C file directly with the -run option, as in tcc -run sourcefile.c 回答2: you can run code without using an editor by using tcc -run - Using

Change current working directory from batch file and run script

感情迁移 提交于 2019-12-24 02:03:49
问题 In Windows 8: I have a php file which needs to be run from the scheduled tasks through .bat file. The PHP is located in: P:\php\php.exe The file to run is located in: W:\folder\file.php my .bat file looks like this: cmd /c p:\php\php.exe w:\folder\file.php It does not run. When I open cmd and switch to the file folder and run it from there, the file executes properly. i.e.: W:\folder> p:\php\php.exe w:\folder\file.php I have to add something to the .bat file which navigates to this w:\folder

How can I keep open the command prompt in my windows form application in c++?

孤者浪人 提交于 2019-12-24 01:19:51
问题 I wrote a project in windows form application in C++ by Visual Studio 2010. I need to open the cmd and then type special command and run other program. I use this function : system("cmd.exe /c dir c:\\"); but by this function I just saw cmd for a second and then it was disappeared. then I add this line : cin.get(); but it did not work. also I use this function : char program[] = "C:\Windows\System32\cmd.exe"; WinExec((LPCSTR)program, SW_SHOWMINIMIZED); but it did not work either! Can you help

Sending commands to stdin and sending end of transmit (Ctrl+D)

孤者浪人 提交于 2019-12-24 00:52:18
问题 I want to run the following code. The application that I'm calling expects commands like User-Name=albert next line, another command and so on, until you are done. If you were to enter this manually from command line, you would type command, press enter, type command press enter. Right at the end AFTER PRESSING ENTER after the last command, you would press Ctrl + D to end it, that runs the program and comes back stating what happened. If you type a command wrong, the application says

os.system not working, but typing the same thing into the command prompt works

懵懂的女人 提交于 2019-12-23 18:53:16
问题 I am trying to run python abaqus through the command prompt using os.system('abaqus CAE noGUI=ODBMechens') It doesn't seem to run anything, but if I go to the command prompt myself and type in abaqus CAE noGUI=ODBMechens it works. I am using python 2.7 on Windows 10. Thanks 回答1: try using the subprocess module (it's newer) instead: for example, subprocess.call(["ls", "-l"]) and in your example, it would be: subprocess.call('abaqus CAE noGUI=ODBMechens') More info on the difference between

my.bat not recognized as an internal or external command, operable program or batch file

痴心易碎 提交于 2019-12-23 17:26:35
问题 When I logon to this Windows 2008 R2 Server and launch a CMD window, the default directory is: C:\Users\SVC_asl2trim> So I added this to the PATH and then I issued: C:\Users\SVC_asl2trim>set path Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32 \WindowsPowerShell\v1.0\;D:\Program Files\Hewlett-Packard\HP TRIM\;C:\Users\SVC_ asl2trim\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC C:\Users\SVC_asl2trim> I have a small .bat file in that directory

Execute shell commands using popen in c++

别来无恙 提交于 2019-12-23 05:14:22
问题 I need to be able to execute some shell commands such as moving to the right directory where I have some files I need to decode and then decoding them using another command. I read some stuff about using popen but I didnt really understand how to use it for executing multiple commands. Any pointers will be greatly appreciated :) Thanks FILE *pf; char command[150]; char data[512]; // Execute a process listing sprintf(command, "cd"); pf = _popen(command,"r"); sprintf(command, "cd Test_copy");

How to Extract the file name from a full path in bat?

大城市里の小女人 提交于 2019-12-23 04:06:55
问题 A variable %result% contains the path "D:\My Folder1\My Folder 2\My Folder 3\The Important File.txt" . I want to store The Important File in some another variable. That is, I want to extract the file name (Without extention) from a full path. 回答1: This should give you what you need. @echo off for %%a in ("%result%") do set "newvariable=%%~na" 回答2: You'll find a solution here: Get the file name from a full or relative path knowing that this one is not a parameter of the batch here: Get

C++ disallow command prompt from displaying

邮差的信 提交于 2019-12-23 04:04:37
问题 Is there any thing I can do to make sure that the shell/command prompt does not show up when I run my C++ program, it is meant to be a background program? While it isn't a huge deal if it displays because it quickly closes, I would prefer it doesn't display at all. Program will run on windows xp/vista/7 OS 回答1: Configure your compiler or linker to mark your program as a GUI application. Windows recognizes two main types of programs: GUI and console. If the EXE header is marked as a console

Run command on remote computer

巧了我就是萌 提交于 2019-12-22 12:41:10
问题 I want to run a command in command prompt on a remote computer using C#. Per this link How to execute a command in a remote computer?, I am trying to do this using the following code: public static void RunRemoteCommand(string command, string RemoteMachineName) { ManagementScope WMIscope = new ManagementScope( String.Format("\\\\{0}\\root\\cimv2", RemoteMachineName)); WMIscope.Connect(); ManagementClass WMIprocess = new ManagementClass( WMIscope, new ManagementPath("Win32_Process"), new