Jump to content
Server Maintenance This Week. ×

win shell command & path


Harald

This topic is 6692 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am stuck - I just want to let FM rename a pdf-file via a send event script with a calculated cmd-string but can't figure out how to tell win2k that this cmd should rename the file in a special folder eg

"cmd /c move /y c:Documents and SettingsAll UsersDocumentsprinted.pdf c:Documents and SettingsAll UsersDocumentsVariableRcdID.pdf"

This does not work at all but:

If this command is done on root level renaming works:

"cmd /c move /y c:printed.pdf c:VariableRcdID.pdf"

So it has something to do with the path names in the cmd-string - how do I force and tell the cmd to use the right folder locations??

Any Ideas or hints?

Link to comment
Share on other sites

I think you will find that the spaces in the Documents and Settings folder name are the cause of the problem. One solution which I have found works on most variations of windows (I do not have Win2000) is to replace Documents and Settings with the old-fashioned DOS name whatever that is on your system - probably Docume~1.

Link to comment
Share on other sites

  • 2 months later...

Here's what I do. the command line is VERY picky about where to use quotation marks. Trying to escape these in calculated fields became a nightmare for me, but I finally conquered it. But that's another story...

Here's the shell code that gets fed to the send event step.


cmd /c If not Exist "C:My Documentsdirectory Amy file.pdf" move "C:Documents and SettingsuserDesktopmy file.pdf" "C:My Documentsdirectory Amy file.pdf"

This does the additional job of checking for an existing file in the destination as not to overwrite it. Just strip out the "if not exist "file" " section if you don't want that.

Hope this helps,

--Perren

Link to comment
Share on other sites

This topic is 6692 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.