Windows 10: DOS Command issued from Batch file

Discus and support DOS Command issued from Batch file in Windows 10 Network and Sharing to solve the problem; I have been running a batch file to list my personal file, and output the listing to a text file in a folder dv7. I then use the text file to compare... Discussion in 'Windows 10 Network and Sharing' started by chasw98, Mar 2, 2020.

  1. chasw98 Win User

    DOS Command issued from Batch file


    I have been running a batch file to list my personal file, and output the listing to a text file in a folder dv7.

    I then use the text file to compare to files on another computer or external drive, as backup.

    For some reason it no longer works.

    The command in the BAT file is:

    @dir "C:\Users\Sales\Zonal\" /o:gn /s /t:w> "C:\Users\Sales\Desktop\For BATCH\dv7\"


    To demo the problem, I included two additional commands - results is in screen capture.

    @dir "C:\Users\Sales\Zonal\"
    @dir "C:\Users\Sales\Desktop\For BATCH\dv7\"

    @dir "C:\Users\Sales\Zonal\" /o:gn /s /t:w> "C:\Users\Sales\Desktop\For BATCH\dv7\"
    Pause Check for errors


    Pic = note the directories are found. and then not found. Why?

    DOS Command issued from Batch file 207e9d3e-335f-4e08-b9a9-44e75480e062?upload=true.jpg

    :)
     
    chasw98, Mar 2, 2020
    #1

  2. How can a batch file do this?!

    did you see this answer taken from stackoverflow ? :

     
    blobster21, Mar 2, 2020
    #2
  3. Batch file

    thank you for your reply. how to merge the codes so that the batch file does this

    the batch file displays the options below

    1. open the *.spl file in notepad
    2. delete the *.shd and *.spl files
    3.exit

    commands execute as options are selected
     
    Sandeep Bhugoo, Mar 2, 2020
    #3
  4. djmcnz Win User

    DOS Command issued from Batch file

    running DOS as ADMIN

    I assume you don't have 'exit' anywhere in your batch file?

    Rather than playing with 'pause' - if you want to see the output...

    1. Open a command window as admin
    2. Run the batch file manually
    3. Command window will not close unless the 'exit' command is issued
    4. Read output
    That's the first step I'd take to diagnose. Then run every line in your batch file manually, one-by-one, in your admin command window (copy and paste from the actual batch file, don't retype the commands).

    You'll soon find your problem.
     
    djmcnz, Mar 2, 2020
    #4
Thema:

DOS Command issued from Batch file

Loading...
  1. DOS Command issued from Batch file - Similar Threads - DOS Command issued

  2. Batch File Command???

    in Windows 10 Gaming
    Batch File Command???: I want to run a batch file that starts a backup program, but does not execute the next command until that program completes? How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/batch-file-command/3af2ce6b-ace3-43cb-b6fb-5cbff8998736
  3. Batch File Command???

    in Windows 10 Software and Apps
    Batch File Command???: I want to run a batch file that starts a backup program, but does not execute the next command until that program completes? How do I do this? https://answers.microsoft.com/en-us/windows/forum/all/batch-file-command/3af2ce6b-ace3-43cb-b6fb-5cbff8998736
  4. Beep Code not working in Windows 10 DOS batch file

    in Windows 10 Customization
    Beep Code not working in Windows 10 DOS batch file: I am able to hear a beep in one computer DOS command whereas not on another computer.Both the laptops have the Windows 10 Pro Operating systemC:\ Powershell "[console]::beep9000,500"What could be the problem?I have checked all other sounds are working on the both the laptops,...
  5. Command Prompt/ Batch files

    in Windows 10 Ask Insider
    Command Prompt/ Batch files: [ATTACH] when i create a batch file to ping something, it spams the command and throws no response. how do i fix this? https://preview.redd.it/fyy6qwrfx7n61.png?width=256&format=png&auto=webp&s=d55552fdc7a5c297d565617f710992048238660c submitted by /u/xWasss [link]...
  6. HOW: Robocopy command to a batch-file

    in Windows 10 Network and Sharing
    HOW: Robocopy command to a batch-file: This working fine in a Command Prompt: robocopy "C:\¤Head Folder\Folder 01\Old folder" "C:\¤Head Folder\Folder 01\New folder" /mov /minage:930 How do I make a Batch file .BAT with that RoboCopy command...
  7. Batch command to include random line from file?

    in Windows 10 Support
    Batch command to include random line from file?: Hello, i was wondering if i can include random line from file into a Windows 10 batch script command. Command is: wmic computersystem where name="%COMPUTERNAME%" call rename name="Computer%RANDOM%" and instead of "Computer%RANDOM%" i would like to input random line from...
  8. DOS format command

    in Windows 10 Network and Sharing
    DOS format command: DOS format command -- a few questions 1 Format /p:2 would do an initial sector zero-fill followed by 2 random fills. What's in a random fill? Is it a sector-long string of a single non-zero character, or a random string of different characters e.g. x'7f38e2 ...'? 2 Is there...
  9. Batch commands

    in Windows 10 Network and Sharing
    Batch commands: I know this stuff is kind of old tech, but would anyone know how to make a script that goes through the contents of a folder or file and uses them as command-line arguments say in pseudocode it might look something like: for each item in Desktop, copy %name% to D:\ a USB...
  10. Batch file hide command window

    in Windows 10 Support
    Batch file hide command window: I have a batch command to back up a subdirectory: xcopy "C:\All\*" "E:\Allback\*" /E /Q How can I hide the command window during the execution? 40984