How can I turn on File and Printer sharing, and the Firewall from the Windows command line

JMK

I am using PsExec to access cmd on a Windows 7 computer on my network, and I want to turn on File and Printer Sharing, followed by the Windows firewall without having to get up and walk all the way to the computer.

What commands do I need to use to do this?

Thanks

Patrick Jørgensen

This command should take care of the File and Printer Sharing:

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes  

For the firewall:

netsh advfirewall set currentprofile state on  

I've tried them just now, and its seems to work for me.

For any additional information see Microsofts KB article: http://support.microsoft.com/kb/947709

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How can I create a file with a specific size from a command line?

분류에서Dev

How I can I start a powershell command line from a batch file and enforce it to stay open?

분류에서Dev

How can I pass command line arguments to a program in a Windows batch file?

분류에서Dev

How Can I tell if the current user is Admin from Windows Command Line

분류에서Dev

How do you create an empty file from the command line in Windows

분류에서Dev

How can I run a specific line as a command in a text file?

분류에서Dev

How can I preview HTML documents from the command line?

분류에서Dev

How can I create a message box from the command line?

분류에서Dev

How can I retrieve the Session ID from command line?

분류에서Dev

How can I invoke a user switch from the command line?

분류에서Dev

Sending pdf files directly to a network printer, using Windows command line

분류에서Dev

How can I get my public IP address from the command line, if I am behind a router?

분류에서Dev

How can I pass parameter in Talend exported job, through command line or bash script file?

분류에서Dev

In windows, can I redirect stdout to a (named) pipe in command line?

분류에서Dev

How can I do disk surface scanning, and fix/reallocate bad sectors in Linux from the command line?

분류에서Dev

How can I kill all child processes of a certain process from the command line?

분류에서Dev

How can I save the last command to a file?

분류에서Dev

How to completely remove printer from Windows 7

분류에서Dev

How to convert a windows batch file into a signle line "cmd /c" command?

분류에서Dev

Can I call the GNOME restart confirmation prompt from the command line?

분류에서Dev

How do I copy the directory and its folders in windows command line?

분류에서Dev

Manage file and printer sharing using a script

분류에서Dev

How to extract attachments from EML files with Windows command line?

분류에서Dev

How can I install one language by command-line

분류에서Dev

How can I import a database using command line?

분류에서Dev

How can I play a song in the background via my command line?

분류에서Dev

How can I remove the last blank line of a wmic command?

분류에서Dev

How can I get a count of files in a directory using the command line?

분류에서Dev

How can I shorten my command line (bash) prompt?

Related 관련 기사

  1. 1

    How can I create a file with a specific size from a command line?

  2. 2

    How I can I start a powershell command line from a batch file and enforce it to stay open?

  3. 3

    How can I pass command line arguments to a program in a Windows batch file?

  4. 4

    How Can I tell if the current user is Admin from Windows Command Line

  5. 5

    How do you create an empty file from the command line in Windows

  6. 6

    How can I run a specific line as a command in a text file?

  7. 7

    How can I preview HTML documents from the command line?

  8. 8

    How can I create a message box from the command line?

  9. 9

    How can I retrieve the Session ID from command line?

  10. 10

    How can I invoke a user switch from the command line?

  11. 11

    Sending pdf files directly to a network printer, using Windows command line

  12. 12

    How can I get my public IP address from the command line, if I am behind a router?

  13. 13

    How can I pass parameter in Talend exported job, through command line or bash script file?

  14. 14

    In windows, can I redirect stdout to a (named) pipe in command line?

  15. 15

    How can I do disk surface scanning, and fix/reallocate bad sectors in Linux from the command line?

  16. 16

    How can I kill all child processes of a certain process from the command line?

  17. 17

    How can I save the last command to a file?

  18. 18

    How to completely remove printer from Windows 7

  19. 19

    How to convert a windows batch file into a signle line "cmd /c" command?

  20. 20

    Can I call the GNOME restart confirmation prompt from the command line?

  21. 21

    How do I copy the directory and its folders in windows command line?

  22. 22

    Manage file and printer sharing using a script

  23. 23

    How to extract attachments from EML files with Windows command line?

  24. 24

    How can I install one language by command-line

  25. 25

    How can I import a database using command line?

  26. 26

    How can I play a song in the background via my command line?

  27. 27

    How can I remove the last blank line of a wmic command?

  28. 28

    How can I get a count of files in a directory using the command line?

  29. 29

    How can I shorten my command line (bash) prompt?

뜨겁다태그

보관