locked
how to import multiple lines from text file into cmd without codes being run RRS feed

  • Question

  • hi friends

    i have a text file which contains this code :

    dcpromo /unattend /InstallDns:yes /ConfirmGC:yes /CreateDNSDelegation:no /dnsOnNetwork:no /replicaOrNewDomain:domain /newDomain:forest /newDomainDnsName:Hp.lab /DomainNetbiosName:HP /databasePath:"%systemroot%\NTDS" /logPath:"%systemroot%\NTDS" /sysvolpath:"%systemroot%\sysvol" /safeModeAdminPassword:Restore@ /forestLevel:4 /domainLevel:4 /rebootOnCompletion:yes


    how can i import that in command prompt, so that i be able to see entire code and perform final check & if needed edit it & then manually press enter to run it?

    copy from text & paste it into cmd, causes each line to be run & it's not what i need.

    also if i change myfile.txt to myfile.bat, when i call it from whithin cmd, it will be run, but i don't want it run. i simple need to transfer entire code from text file to cmd, without executing when inserted into cmd.

    thanks in advanced


    • Edited by john.s2011 Friday, November 28, 2014 8:45 PM
    Friday, November 28, 2014 8:31 PM

Answers

  • copy from text & paste it into cmd, causes each line to be run & it's not what i need.

    Here you go:

    1. Copy the code into a notepad.exe screen.
    2. Remove all hard line breaks.
    3. Mark the code then press Ctrl+C
    4. Open a Command Prompt.
    5. Right-click anywhere on the screen, then left-click "paste".
    • Marked as answer by john.s2011 Friday, November 28, 2014 9:29 PM
    Friday, November 28, 2014 9:09 PM

All replies

  • copy from text & paste it into cmd, causes each line to be run & it's not what i need.

    Here you go:

    1. Copy the code into a notepad.exe screen.
    2. Remove all hard line breaks.
    3. Mark the code then press Ctrl+C
    4. Open a Command Prompt.
    5. Right-click anywhere on the screen, then left-click "paste".
    • Marked as answer by john.s2011 Friday, November 28, 2014 9:29 PM
    Friday, November 28, 2014 9:09 PM
  • copy from text & paste it into cmd, causes each line to be run & it's not what i need.

    Here you go:

    1. Copy the code into a notepad.exe screen.
    2. Remove all hard line breaks.
    3. Mark the code then press Ctrl+C
    4. Open a Command Prompt.
    5. Right-click anywhere on the screen, then left-click "paste".

    Hi Frederik

    worked. thank you very much

    Friday, November 28, 2014 9:30 PM