New Batch scripter, Please help.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

New Batch scripter, Please help.

#1 Post by Dewars » 12 Apr 2012 07:52

Hello all

I'm just getting into batch scripting and seem to have struck a problem.
I've managed to create a new Folder with the "MD C:\..." command.
Now I want to display hidden files on the C: drive, but it just tells me "The system cannot find the path specified".

The command I entered was: "DIR C:\ /A:H".

I've even tried simply putting "DIR C:" and "DIR C:\", to no avail.

Any help would be greatly appreciated.

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

Re: New Batch scripter, Please help.

#2 Post by Squashman » 12 Apr 2012 07:56

Are you saying that the following command does not work for you? It gives you no output and gives you an error? If so what is the error?

Code: Select all

dir C:\

Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

Re: New Batch scripter, Please help.

#3 Post by Dewars » 12 Apr 2012 07:59

Yes, I tried that and it said "The system cannot find the path specified".

Very confused.

Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

Re: New Batch scripter, Please help.

#4 Post by Dewars » 12 Apr 2012 08:06

This is my code:
MD C:\"Batch Script"
DIR C:\

It makes the folder, then shows the error I mentioned.

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

Re: New Batch scripter, Please help.

#5 Post by Squashman » 12 Apr 2012 08:06

Well if you made a directory on the C:\ drive you should have a C:\ drive and you should be able to get a directory listing.

Open up a cmd prompt and type the following command.

Code: Select all

C:\>fsutil fsinfo drives

Then right click on the Window Title Bar.
Chose Edit
Chose Select All
Then hit the Enter Key.
This copies everything from the command window to the clipboard.
Paste that output here.

Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

Re: New Batch scripter, Please help.

#6 Post by Dewars » 12 Apr 2012 08:12

CD C:\
fsutil fsinfo drives

Comes up with the error "The fsutil utility requires you have administrative privileges"

Fawers
Posts: 187
Joined: 08 Apr 2012 17:11
Contact:

Re: New Batch scripter, Please help.

#7 Post by Fawers » 12 Apr 2012 09:11

Dewars wrote:Comes up with the error "The fsutil utility requires you have administrative privileges"


Can you run CMD as an administrator? If yes, do it and run the code again.

Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

Re: New Batch scripter, Please help.

#8 Post by Dewars » 12 Apr 2012 09:44

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\windows\system32>CD C:\

C:\>fsutil fsinfo drives

Drives: C:\ D:\ E:\ F:\ G:\

C:\>

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: New Batch scripter, Please help.

#9 Post by foxidrive » 12 Apr 2012 09:50

Run this batch file and paste the screen output into a reply.

@echo off
md "c:\Batch Script" 2>nul
dir c:\b* /b
pause

Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

Re: New Batch scripter, Please help.

#10 Post by Dewars » 12 Apr 2012 10:29

Batch Script
Press any key to continue . . .

Fawers
Posts: 187
Joined: 08 Apr 2012 17:11
Contact:

Re: New Batch scripter, Please help.

#11 Post by Fawers » 12 Apr 2012 10:34

Dewars wrote:Batch Script
Press any key to continue . . .


It means the folder was created successfully.

Dewars
Posts: 11
Joined: 12 Apr 2012 07:44

Re: New Batch scripter, Please help.

#12 Post by Dewars » 12 Apr 2012 10:46

I think everything is working fine now. Thanks to everyone that helped.

Post Reply