Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Batch file (basics!)


  • Please log in to reply
33 replies to this topic

#1 teatrap

teatrap

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 03:54 PM

Hello (first post)  :)

 

I'm trying to write a basic batch file at the moment, but I keep getting the following error message :
 
T4F0oWS.png
 
I'm not sure what I'm doing wrong to get the name (for example, a folder on my desktop) I'm doing the following -
 
  • File Explorer
 
  • Desktop 
 
  • Open folder
 
  • Click in the info bar
 
s9mXMPn.png
 
Copy info into the notepad
 
save as a batch file.... 
 
But when I try to run the batch file I keep getting that error message.... :confused:
 
cheers
 
I'm in Window's 8.1 Pro. 
 
 
Moderator edit: Moved from the DOS Forum to a more appropriate forum.
Roger

Edited by rotor123, 04 November 2013 - 05:07 PM.

Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


BC AdBot (Login to Remove)

 


#2 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 04:04 PM

Updated my signature... 

 

EDIT -oops, can't do that yet! System info is in my profile though


Edited by teatrap, 04 November 2013 - 04:05 PM.

Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#3 ratbuddy

ratbuddy

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:03:02 PM

Posted 04 November 2013 - 05:14 PM

The error message and the explorer window seem to have different lenghts of blacked out area. Do the blacked out areas say the same thing?



#4 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 05:47 PM

The error message and the explorer window seem to have different lenghts of blacked out area. Do the blacked out areas say the same thing?

 

Yes, they are both my user name. Although I think that one of them is my full name and one of them is just my first name :?


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#5 ratbuddy

ratbuddy

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:03:02 PM

Posted 04 November 2013 - 06:00 PM

Seems like it's not handling the space in your username. I don't have Windows 8 so I can't test how it behaves.



#6 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 06:02 PM

Seems like it's not handling the space in your username. I don't have Windows 8 so I can't test how it behaves.

 

I'll test it now - but is my method is sound? 


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#7 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 06:05 PM

Just tried it, I still get the same error message without the space in my user name

 

the script I'm using is :

 

start C:\Users\MYNAME\Desktop\Programes


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#8 ratbuddy

ratbuddy

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:03:02 PM

Posted 04 November 2013 - 06:10 PM

Sorry, got me. Works fine for me on Vista.

 

I have a Windows 8.1 tablet arriving tomorrow, if you don't figure it out by then, I'll see what I can figure out. I do quite a lot of batch stuff, so I hope it works right on 8.1 :)



#9 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 06:23 PM

Ah damn.... So just to be clear

 

start C:\Users\MYNAME\Desktop\Programes

 

works fine for you? 

 

cheers


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#10 cmptrgy

cmptrgy

  • Members
  • 1,656 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Massachusetts
  • Local time:04:02 PM

Posted 04 November 2013 - 06:31 PM

start C:\Users\MYNAME\Desktop\Programes

Is Programes the right spelling?



#11 ratbuddy

ratbuddy

  • Members
  • 26 posts
  • OFFLINE
  •  
  • Local time:03:02 PM

Posted 04 November 2013 - 06:51 PM

Ah damn.... So just to be clear

 

start C:\Users\MYNAME\Desktop\Programes

 

works fine for you? 

 

cheers

 

No, because that folder doesn't exist on my rig. I used one that does.


Edited by ratbuddy, 04 November 2013 - 06:51 PM.


#12 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 04 November 2013 - 07:20 PM

 

Ah damn.... So just to be clear

 

start C:\Users\MYNAME\Desktop\Programes

 

works fine for you? 

 

cheers

 

No, because that folder doesn't exist on my rig. I used one that does.

 

 

Hmm, but opening a folder from the desktop does?

 

I'm going to see If I can find any similar scripts to test it out with...  


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#13 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:03:02 PM

Posted 05 November 2013 - 08:40 AM

Try wrapping the script path inside a pair of quotes " ", e.g.,

start "C:\Hello\This is my script\beep.bat"


#14 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:09:02 PM

Posted 05 November 2013 - 08:52 AM

 

Try wrapping the script path inside a pair of quotes " ", e.g.,

start "C:\Hello\This is my script\beep.bat"

Hi Romeo - Different error message! (Which may be a small step??)

 

So when I run the command in quotes I get the following message within the cmd prompt :

 

ReY0acF.png


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


#15 cmptrgy

cmptrgy

  • Members
  • 1,656 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Massachusetts
  • Local time:04:02 PM

Posted 05 November 2013 - 09:22 AM

Well I hate to bring up the spelling question again

Previously I had asked if Programes is the right spelling

In the command prompt you posted its spelled programs

--- Doesn't that make a difference on what is trying to be executed?

And yes the quotes should make a difference and if I remember correctly it's because there are spaces within the text portion

--- Maybe if you close up the text portion you can compare it both ways: with/without the quotes

 

It's been a while since I've worked with batch files but those are my observations






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users