Please Help: Why am I now getting this error 
Author Message
 Please Help: Why am I now getting this error

Please Help.  I have this script that was working and not isn't for some
reason (I don't know why but I have been able to get it to work on
ocassion).  Basically the script takes all pictures in a folder, edits them
and then moves them.  But I get an error as followed:

Line 6
Char: 9 (that corresponds to the char. starting at shell.run . . .
The error is: The System Cannot Find the File Specified
Code 80070002
Source: (null)

There are files in that folder and the script was working fine before so I
don't understand it.  Any thoughts Please

set fso=createobject("scripting.filesystemobject")
set fd=fso.getfolder("I:\pictures1")
set shell=createobject("wscript.shell")

for each f in fd.files
        shell.run "I:\pictures1\" & f.name,, false
        wscript.sleep 200
        shell.sendkeys "^r", 1
 wscript.sleep 200
        shell.sendkeys "^q", 1
 wscript.sleep 200
        shell.sendkeys "%", 1
 wscript.sleep 200
        shell.sendkeys "I", 1
 wscript.sleep 200
 shell.sendkeys "z", 1
 wscript.sleep 200
 shell.sendkeys "150", 1
 wscript.sleep 200
 shell.sendkeys "{enter}", 1
        wscript.sleep 200
 shell.sendkeys "^s", 1
        wscript.sleep 200
 shell.sendkeys "%", 1
        wscript.sleep 200
 shell.sendkeys "F", 1
 wscript.sleep 200
 shell.sendkeys "x", 1
 wscript.sleep 1000
        fso.movefile "I:\pictures1\" & f.name, "I:\pictures\edited\" &
f.name
next



Mon, 29 Aug 2005 03:37:23 GMT  
 Please Help: Why am I now getting this error
Actually I spend all this time trying to figure it out and once I asked the
group, I figured it out.  It was because my file names have spaces in the
name (for example picture 1.jpg).  Is there a way to make sure the script
still works even if their are spaces in the name?


Quote:
> Please Help.  I have this script that was working and not isn't for some
> reason (I don't know why but I have been able to get it to work on
> ocassion).  Basically the script takes all pictures in a folder, edits
them
> and then moves them.  But I get an error as followed:

> Line 6
> Char: 9 (that corresponds to the char. starting at shell.run . . .
> The error is: The System Cannot Find the File Specified
> Code 80070002
> Source: (null)

> There are files in that folder and the script was working fine before so I
> don't understand it.  Any thoughts Please

> set fso=createobject("scripting.filesystemobject")
> set fd=fso.getfolder("I:\pictures1")
> set shell=createobject("wscript.shell")

> for each f in fd.files
>         shell.run "I:\pictures1\" & f.name,, false
>         wscript.sleep 200
>         shell.sendkeys "^r", 1
>  wscript.sleep 200
>         shell.sendkeys "^q", 1
>  wscript.sleep 200
>         shell.sendkeys "%", 1
>  wscript.sleep 200
>         shell.sendkeys "I", 1
>  wscript.sleep 200
>  shell.sendkeys "z", 1
>  wscript.sleep 200
>  shell.sendkeys "150", 1
>  wscript.sleep 200
>  shell.sendkeys "{enter}", 1
>         wscript.sleep 200
>  shell.sendkeys "^s", 1
>         wscript.sleep 200
>  shell.sendkeys "%", 1
>         wscript.sleep 200
>  shell.sendkeys "F", 1
>  wscript.sleep 200
>  shell.sendkeys "x", 1
>  wscript.sleep 1000
>         fso.movefile "I:\pictures1\" & f.name, "I:\pictures\edited\" &
> f.name
> next



Mon, 29 Aug 2005 03:52:05 GMT  
 Please Help: Why am I now getting this error

Quote:

> Actually I spend all this time trying to figure it out and once I asked the
> group, I figured it out.  It was because my file names have spaces in the
> name (for example picture 1.jpg).  Is there a way to make sure the script
> still works even if their are spaces in the name?

Hi

Both methods below should solve your problem:

shell.run """I:\pictures1\" & f.name & """",, False

shell.run Chr(34) & "I:\pictures1\" & f.name & Chr(34),, False

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Mon, 29 Aug 2005 03:58:51 GMT  
 Please Help: Why am I now getting this error
thank you. You are the best


Quote:

> > Actually I spend all this time trying to figure it out and once I asked
the
> > group, I figured it out.  It was because my file names have spaces in
the
> > name (for example picture 1.jpg).  Is there a way to make sure the
script
> > still works even if their are spaces in the name?

> Hi

> Both methods below should solve your problem:

> shell.run """I:\pictures1\" & f.name & """",, False

> shell.run Chr(34) & "I:\pictures1\" & f.name & Chr(34),, False

> --
> torgeir
> Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of the 1328 page
> Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Mon, 29 Aug 2005 04:05:54 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. I am getting an error Please help if you can

2. Why am I getting this error ?

3. why am I getting this error??

4. Null Values - WHY am I getting this error?

5. Help - I am getting an error using data control

6. Why am I getting this message?

7. Why am I getting a Closed Recordset

8. Please, please help, I am desperated...:(

9. error 91 please help as i am stuck

10. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

11. Getting Error 13, help - don't understand why

12. I am getting errors I can't pin down

 

 
Powered by phpBB® Forum Software