bat file open up dir and send command line

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
VbAzza
Posts: 2
Joined: 27 Jan 2012 04:25

bat file open up dir and send command line

#1 Post by VbAzza » 27 Jan 2012 04:31

Hi Guys,

I probably get flamed for this post but I'm need some advise or help in making

bat file

I needed it to when clicked on i need it to goto straight to C:\folder directory\

then execute a command line and pause till user exits or clicks continue

I tried few things and could not get it to echo the comand line but could get it to open up cmd and get me to the folder directory i wanted and thats it

can some one please help

VbAzza

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: bat file open up dir and send command line

#2 Post by Squashman » 29 Jan 2012 08:15

I always like people to post the code they tried to at least get a better understanding of what they are trying to do.

If you need to change the working directory you could do that two ways. You can use the CD or PUSHD command.

CD /D "C:\Path to Folder"
or
PUSHD "C:\Path to Folder"
Then execute whatever other commands you need to execute.
Then you can use the PAUSE command to force the user to type a key to continue.

VbAzza
Posts: 2
Joined: 27 Jan 2012 04:25

Re: bat file open up dir and send command line

#3 Post by VbAzza » 30 Jan 2012 05:39

Hi Squashman,

thanks for the reply i figured out how to changed directories.

but how do i execute the "fc /b nand1.bin nand2.bin" command


sorry really suck in dos which probably the easiest

VBAzza

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: bat file open up dir and send command line

#4 Post by Squashman » 30 Jan 2012 07:17

You posted the correct syntax for running the FC command. The only issue may be is if those two files do not exist in the Working Directory.
This should work just fine. Just as you posted it.
fc /b nand1.bin nand2.bin

But if those two files do not exist in the working directory then you need to put the full path to the files.

fc /b "C:\path to folder\nand1.bin" "C:\path to folder\nand2.bin"

Post Reply