How to use CMD (Hidden & Shown) using C# Visual Studio

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024

ความคิดเห็น • 67

  • @caarlozzz
    @caarlozzz 2 ปีที่แล้ว +1

    Thanks i just start learning vb, and your video help me to create my own program

  • @ShinyGorilla
    @ShinyGorilla 4 หลายเดือนก่อน

    Remember there’s always a random underrated Indian TH-camr that can help you with anything

    • @HassaanRaza
      @HassaanRaza  4 หลายเดือนก่อน

      haha this time its a Pakistani, my dude.

  • @winnumber101
    @winnumber101 3 ปีที่แล้ว +1

    thank you... I've been looking around for this capability

  • @darrenhind9948
    @darrenhind9948 3 ปีที่แล้ว +1

    Great tutorial thanks, your code works great behind button click event too.

  • @videoajans5999
    @videoajans5999 3 ปีที่แล้ว +1

    Thank you, a really simple explain.

  • @carlospenauscanga6065
    @carlospenauscanga6065 ปีที่แล้ว

    Excellent Bro. Thank you so much for this explanation

  • @titan7495
    @titan7495 4 ปีที่แล้ว +3

    Thanks bro Love You
    xD

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว +2

      haha love you too.

    • @titan7495
      @titan7495 4 ปีที่แล้ว +3

      @@HassaanRaza 😍

    • @titan7495
      @titan7495 4 ปีที่แล้ว

      @Legend Saim bhut pahle dekhe te ab mai ye method use ni karta

  • @pje_
    @pje_ 2 ปีที่แล้ว +3

    How to run two or more commands in one line:
    You must write && between commands.
    Ex: echo hey just && echo a moment && md %userprofile%\Desktop\meo && echo Wuhoo! I created one folder!

  • @pew8208
    @pew8208 4 ปีที่แล้ว

    thanks, i learned one more thing, make more videos like this...you helped me, i liked :)

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว

      yes I'll be making more of these videos please subscribe so we keep doing good stuff 😄

    • @pew8208
      @pew8208 4 ปีที่แล้ว

      @@HassaanRaza wait i got 13 erros lol

    • @pew8208
      @pew8208 4 ปีที่แล้ว

      @@HassaanRaza can you give me your source code?

  • @Synalix
    @Synalix 3 ปีที่แล้ว +1

    I am a little bit comfused of the video. What should i type to open an already created cmd file? sorry if i am asking too much,i dont know to use the visual studio well...

    • @HassaanRaza
      @HassaanRaza  3 ปีที่แล้ว

      you shouldn't be sorry for asking any type of question brother,
      maybe you are looking for something like this:
      th-cam.com/video/l9h5Y_uxNy4/w-d-xo.html

    • @Synalix
      @Synalix 3 ปีที่แล้ว

      @@HassaanRaza ty you are the best

  • @franciscobeltran1101
    @franciscobeltran1101 2 ปีที่แล้ว

    I'm doing this on visual basic but the argument start with "@/c ..." what is the equivalence please

  • @K11d602
    @K11d602 8 หลายเดือนก่อน

    Hi, is it possible to save text from the command prompt using this method?, i mean, using "systeminfo>C:\Windows\Textfile.txt" on command prompt works and creates a txt file with the system information in that path, but when i put this command on C# it creates the txt file in that path, but the txt file is empty, even running it as administrator by adding ps.Verb = "runas"; what can i do

  • @talhaahmed2437
    @talhaahmed2437 4 ปีที่แล้ว +3

    Is there any way to run cmd as admin using c#?

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว +4

      setting the verb property to "runsas" gives it administrative rights.
      System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
      psi.Verb = "runas";

  • @RajSharma-ui5vq
    @RajSharma-ui5vq 2 ปีที่แล้ว

    how to run another command after the first one? Suppose the forst command is going to a certain directory and the second commmand is making directory

  • @808MAN
    @808MAN 3 ปีที่แล้ว +1

    mine just opens the cmd and does nothing

    • @HassaanRaza
      @HassaanRaza  3 ปีที่แล้ว

      you are giving commands as a string a little mistake can result in the "cmd doing nothing".

  • @Kaboomnz
    @Kaboomnz 3 ปีที่แล้ว

    excellent thank you

  • @carlososegueda8012
    @carlososegueda8012 4 ปีที่แล้ว +1

    if i want execute another command? for example: first going to another dir, and second make a new folder in there.Thanks

    • @chrisdan81
      @chrisdan81 4 ปีที่แล้ว +1

      José Carlos Osegueda have you figure it out?

  • @Calocarv
    @Calocarv ปีที่แล้ว

    Any idea how to use cmd in a Specflow - [BeforeScenario] code block?

  • @madin8778
    @madin8778 3 ปีที่แล้ว

    Nice. Thanks )

  • @chjayakrishnajk
    @chjayakrishnajk 4 ปีที่แล้ว

    Again you have helped me bro but when the application opens cmd it is not closing so it is taking much ram because I am using an infinite loop. So i want to end that process how can i do that. please reply fast bro urgent

  • @808MAN
    @808MAN 3 ปีที่แล้ว

    How to run multiple commands one after one?

  • @laggybot1327
    @laggybot1327 4 ปีที่แล้ว +2

    for powershell ???

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว

      read this:
      stackoverflow.com/questions/30844292/running-a-powershell-script-from-c-sharp

  • @uslph.
    @uslph. 3 ปีที่แล้ว +1

    2:14 what was the @ symbol for?

    • @HassaanRaza
      @HassaanRaza  3 ปีที่แล้ว

      @ before a string denotes that the string contains address (this helps us with the forward and backward slashes present in any address).

  • @TheMagicChestplate
    @TheMagicChestplate 4 ปีที่แล้ว +1

    Is it possible to set a function within a C# script as the argument by any chance?

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว

      no its not, you can set the resultant type which the function returns (as an argument), but not the function it self.

    • @TheMagicChestplate
      @TheMagicChestplate 4 ปีที่แล้ว

      @@HassaanRaza Ah alright, thanks

  • @videoajans5999
    @videoajans5999 3 ปีที่แล้ว

    Ok. How to show log output in textbox?

  • @neerajchouksey8507
    @neerajchouksey8507 3 ปีที่แล้ว

    Awesome and very clear video . How can we get output of cmd operation back to c#

    • @HassaanRaza
      @HassaanRaza  3 ปีที่แล้ว

      save it in a file and then read from it.

  • @nguyenthao-si6tu
    @nguyenthao-si6tu 2 ปีที่แล้ว

    how to run cmd.exe as administrator.?

  • @gaurav.69420
    @gaurav.69420 4 ปีที่แล้ว

    You earned a sub

  • @wolfdemn
    @wolfdemn 2 ปีที่แล้ว

    Can you help me? even though the file path is in double quotes, it just doesn't recognize it as the path since I've got white space in my account name

    • @rahulvishwakarma6663
      @rahulvishwakarma6663 ปีที่แล้ว

      I too have a whitespace in my account name. Nothing serious about it. Just use backward slash (\) in your location. Like:
      C:\User\Wolf is a demon.\Desktop

  • @ayecorey1852
    @ayecorey1852 2 ปีที่แล้ว

    Hey sir, I need some help. We have changed providers and need one of our clickonce apps to point to the new server. Any suggestestions? Our programmer was laid off. Thanks man

    • @degenerategamblingclub1480
      @degenerategamblingclub1480 ปีที่แล้ว

      that seems stupid to lay off your programmer just saying hope it got solved in a timely manner no offense by the way

  • @EleazarRosario
    @EleazarRosario 2 ปีที่แล้ว

    how can I make an installer with this?

  • @Thepostroun
    @Thepostroun 3 ปีที่แล้ว

    quality 100%

  • @arnabghosh358
    @arnabghosh358 4 ปีที่แล้ว +1

    Can i do that from any settings of visual studio?

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว

      if you mean using any framework of visual studio, well yes.

  • @alfredo3166
    @alfredo3166 3 ปีที่แล้ว

    thanks

  • @amirhesamhashemi9671
    @amirhesamhashemi9671 4 ปีที่แล้ว +1

    how to run cmd(admin) in C#?

    • @HassaanRaza
      @HassaanRaza  4 ปีที่แล้ว +1

      setting the verb property to "runsas" gives it administrative rights.
      System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
      psi.Verb = "runas";

    • @amirhesamhashemi9671
      @amirhesamhashemi9671 4 ปีที่แล้ว

      @@HassaanRaza Thanks

  • @TuTienPathofcultivations-qb2gy
    @TuTienPathofcultivations-qb2gy 3 หลายเดือนก่อน

    /k what it means

  • @lightludology9081
    @lightludology9081 2 ปีที่แล้ว

    Using similar logic this opens an executable in visual studios script. Fighting with this one for a while, super amazing help in the video
    ProcessStartInfo ps = new ProcessStartInfo();
    ps.FileName = "cmd.exe";
    ps.WindowStyle = ProcessWindowStyle.Normal;
    ps.Arguments = @"/c start .exe";
    Process.Start(ps);
    Thank you thank you thank you

  • @degenerategamblingclub1480
    @degenerategamblingclub1480 ปีที่แล้ว

    what if i wanted to run a command like (arduino-cli upload -p COM5 -b teensy:avr:teensy41 -i C:\Users\Seth\source
    epos\Christmas\N_Owl_Install\bin\Debug
    ight.ino.hex) through a c# command prompt thanks for the help

  • @urumi737
    @urumi737 3 ปีที่แล้ว

    I HAVE SEARCHED TONS OF VIDEO BUT YOUR ONES SOLVE MY SOLUTION

    • @HassaanRaza
      @HassaanRaza  3 ปีที่แล้ว

      delighted to hear that :)

  • @Ax1F1LiS
    @Ax1F1LiS ปีที่แล้ว +1

    wtf

  • @Trinable555
    @Trinable555 3 ปีที่แล้ว

  • @pew8208
    @pew8208 4 ปีที่แล้ว

    all errors fixed